Advertisement
Iire

$tcode Untested

Aug 13th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.56 KB | None | 0 0
  1. ; Simple local text encoder/decoder
  2. ; Syntax: $tcode(TEXT[,0|*])
  3. ; Encodes TEXT if second parameter is 0 or $null. Else attempts to decode.
  4. ; SHOULD be able to decode properly when used in a single small script. May fail on large scripts.
  5.  
  6. alias tcode {
  7.   tokenize 32 $1 $calc($2)
  8.   var %i 1, %e $ticks
  9.   bset -t &x 1 $1
  10.   while $bvar(&x,%i) {
  11.     bset -t &y 1 $+($bvar(&y,1-).text,$chr($calc($v1 $iif($2,/,*) %e)))
  12.     inc %i
  13.   }
  14.   return $bvar(&y,1-).text
  15. }
  16.  
  17. ; Reminder: Look up /bcopy syntax and use in while loop.
  18. ; -- Should allow for longer lines.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement