This snipped translates $chr's to binary code. It's very simple to use it, just $bin(). It translates $chr(32) also, so if you wanna traslate for ex. "Hello World." again just - $bin(Hello World.). $bin() will return the binary code of all $chr's in $1-. Hope you can use it for something.
;Binary Translator
;By: trance @ hawkee.com
;E-mail: trance@trakia.net
;Syntax: $bin()
alias bin {
if ($1) {
set %chars $len($1-)
var %asc
while (%chars >= 1 ) {
set %asc $+(%asc,$chr(32),$asc($right($left($1-,%chars),1)))
dec %chars
}
return $parse_asc(%asc)
}
}
alias parse_asc {
if ($1) {
var %bin
set %tokens $numtok($1-,32)
while ( %tokens >= 1 ) {
set %asc_chr $gettok($1-,%tokens,32)
var %temp.bin.chr
while ( $calc(%asc_chr / 2 ) != 0.5 ) {
if ($calc(%asc_chr / 2 ) != $round($calc(%asc_chr / 2 ),0)) {
set %temp.bin.chr $+(%temp.bin.chr,1)
set %asc_chr $calc($calc(%asc_chr - 1) / 2)
}
else {
set %temp.bin.chr $+(%temp.bin.chr,0)
set %asc_chr $calc(%asc_chr / 2)
}
}
set %bin $+(%bin,$chr(32),%temp.bin.chr)
dec %tokens
}
return %bin
}
}