rendered paste bodyalias rainbow {
var %temp = 1, %max = $len($1-), %char, %string, %color = 8 4 6 12 11 13 9, %cs = $rand(1,$numtok(%color,32))
while (%temp <= %max) {
%char = $mid($1-,%temp,1)
if (%char isnum) %string = %string $+ $+ $gettok(%color,%cs,32) $+ ,99 $+ %char
elseif (%char = $chr(32)) {
inc %temp
%char = $mid($1-,%temp,1)
%string = %string $+ $gettok(%color,%cs,32) $+ %char
}
else {
%string = %string $+ $+ $gettok(%color,%cs,32) $+ %char
}
inc %temp
inc %cs
if (%cs > $numtok(%color,32)) {
%cs = 1
}
}
if ($isid) {
return %string
}
else {
msg # %string
}
}