i hadn't played with mIRC in a while and i figured this would be fun
this converts text to binary/binary to text
uses:
$binary(hello) = 0110100001100101011011000110110001101111
$binary(0110100001100101011011000110110001101111) = hello
alias binary {
if ($regex($$1-,/^([01]{8})+$/)) {
.noop $regex(bin,$1-,/([01]{8})/g)
var %a = 1,%b = 128 64 32 16 8 4 2 1,%bin
while ($regml(bin,%a) != $null) { var %bin = $+(%bin,$iif($chr($calc($regsubex($v1,/(\d)/g,$+($calc($gettok(%b,\n,32) * \t),+)))) == $chr(32),$v1),$v1) | inc %a }
}
else {
var %chr = $regsubex($$1-,/(.)/g,$+($asc(\t),$chr(32))),%a = $numtok(%chr,32),%bin
while (%a) {
var %b = $gettok(%chr,%a,32),%c = 1,%d,%e
while (%c <= 8) { var %d = $floor($calc(%b /2)),%e = $+($calc(%b % 2),%e),%b = %d | inc %c }
%bin = $+(%e,%bin)
dec %a
}
}
$iif($isid,return,echo -a) %bin
}
sunslayer, are you sure kathy is not a spam? 'cause she sure sounds like one to me...
She also posted in another thread with a sentence that looks as if it was translated with an online translator. She seems to be posting "incoherently and inconsistently."
And if she was really a spam, you sure were gullible and naive to respond to her. lol i didn't really understand anything she said but i took it as a compliment lol
sunslayer, are you sure kathy is not a spam? 'cause she sure sounds like one to me...
She also posted in another thread with a sentence that looks as if it was translated with an online translator. She seems to be posting "incoherently and inconsistently."
And if she was really a spam, you sure were gullible and naive to respond to her. lol
sunslayer, you missed the #:msg #lol
@naruto7
ask in the mIRC snippet requests forum
It's working for me.
I entered: !binary hello naruto7
Returns:
01101000011001010110110001101100011011110010000001101110011000010111001001110101011101000110111100110111
Conversely,
!binary 01101000011001010110110001101100011011110010000001101110011000010111001001110101011101000110111100110111
Returns hello naruto7
its still not working just give me the full script with the part u edited
mine is set like this
on $*:text:$(/^!binary ( $+ $2- $+ )/iS):*:{
msg $iif(#,#,$nick) $binary($2-)
}
alias binary {
if ($regex($$1-,/^([01]{8})+$/)) {
.noop $regex(bin,$1-,/([01]{8})/g)
var %a = 1,%b = 128 64 32 16 8 4 2 1,%bin
while ($regml(bin,%a) != $null) { var %bin = $+(%bin,$iif($chr($calc($regsubex($v1,/(\d)/g,$+($calc($gettok(%b,\n,32) * \t),+)))) == $chr(32),$v1),$v1) | inc %a }
}
else {
var %chr = $regsubex($$1-,/(.)/g,$+($asc(\t),$chr(32))),%a = $numtok(%chr,32),%bin
while (%a) {
var %b = $gettok(%chr,%a,32),%c = 1,%d,%e
while (%c <= 8) { var %d = $floor($calc(%b /2)),%e = $+($calc(%b % 2),%e),%b = %d | inc %c }
%bin = $+(%e,%bin)
dec %a
}
}
$iif($isid,return,echo -a) %bin
}