Glue v2 - $IRCdNumeric for me

By Spoofing on Nov 22, 2010

This is second version of $glue snippet, [ string $+ &bvars ]

//bset -t &world 1 world | echo -a $bvar($ircdnumeric(hello,$chr(32),&world),1-)
returns: 104 101 108 108 111 32 32 32 119 111 114 108 100

104 101 108 108 111 - string 'hello'
32 - separator
32 - $chr(32)
32 - separator
119 111 114 108 100 - binary variable '&world'

  • $lf as separator
  • multispace
  • new while

I use this for my IRCd on mIRC :)
Screenshot: http://img832.imageshack.us/img832/3333/ircdnumeric.png

alias ircdnumeric {
  var %i = 1
  while (%i <= $0) {
    var %0 = $replace($ [ $+ [ %i ] ],$chr(32),$lf), %i = %i + 1
    if (&?* iswm %0) {
      bcopy -c &numeric $calc($bvar(&numeric,0) + 1) %0 1 -1
    }
    elseif (%0) {
      bset -t &numeric $calc($bvar(&numeric,0) + 1) $v1
    }
    if ($ [ $+ [ %i ] ]) {
      bset &numeric $calc($bvar(&numeric,0) + 1) 32
    }
  }
  breplace &numeric 10 32
  return &numeric
}

Comments

Sign in to comment.
Aucun50   -  Nov 22, 2010

Kinda the same thing here. "You may not post an updated snippet separately, you need to edit your first post." Not that it's a big deal, nice script btw.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.