$binarytext()
Posted by rannmann
Thursday, October 18, 2007
Description: Binary -> ascii

/binarytext {
  var %let = $calc( $len($1-) / 8),%y = $1
  while (%let > 0) {
    var %char = $chr($base($left(%y,8),2,10))
    ; mIRC will not allow appending a space to the end of a variable (treats as null).  This is my fix.
    if (%char == $chr(32)) { var %char = $chr(7) }
    var %x = %x $+ %char
    var %y = $right(%y,-8)
    dec %let
  }
  return $replace(%x,$chr(7),$chr(32))
}
An issue...
Posted by rannmann
Thursday, October 18, 2007 04:46am PDT
mIRC treats space as null, so I had to do a replace with the char before appending to the var, and then replaced them back again afterwards.  I used chr 7 which is the system beep as to avoid any problems with any crlfs or anything important.
$chr(32)
Posted by leaX
Thursday, October 18, 2007 04:49am PDT
$chr(32) can be used as space
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world