Msg Encoder
Posted by CrashB
Saturday, May 29, 2004
Description: specially written to hide your msg from the people you are talking about!
Usage: /encsay message here
results: sends an encoded message to the current channel (or if you are in a query, that person will recieve an encoded message)
The snippet will also decode anything that fits its layout design that is said and you can see.
Usage: /encsay message here
results: sends an encoded message to the current channel (or if you are in a query, that person will recieve an encoded message)
The snippet will also decode anything that fits its layout design that is said and you can see.
alias encsay {
var %dif $rand(33,255)
var %line $replace($1-,$chr(32),$chr(5))
var %new $null
var %i 1
while %i <= $len(%line) {
var %chr $asc($mid([ %line ],[ %i ],1))
if %chr >= 33 {
var %newchr $calc(%chr + %dif)
if %newchr > 255 {
var %newchr $calc((%newchr - 256) + %dif)
}
}
else {
var %newchr %chr
}
var %new %new $+ $chr(%newchr)
inc %i
}
msg $active $calc((((%dif * 2) - 3) / 4) * 1000) $+ !ENC %new
}
on *:text:*!ENC *:*:{
if $gettok($1,1,33) isnum {
var %dif $calc(((($gettok($1,1,33) / 1000) * 4) + 3) / 2)
var %line $2-
var %new $null
var %i 1
while %i <= $len(%line) {
var %chr $asc($mid([ %line ],[ %i ],1))
if %chr >= 33 {
var %newchr $calc(%chr - %dif)
if %newchr < 33 {
var %newchr $calc(255 - %newchr)
}
}
else {
var %newchr %chr
}
var %new %new $+ $chr(%newchr)
inc %i
}
echo $color(highlight text) -a Decoded: $replace([ %new ],$chr(5),$chr(32))
}
}