Wouldnt it be easier to use something like:
on :INPUT::{
if ($1 == !off) { %text = off | echo Text formatting is off | halt }
if ($1 == !random) { %text = rand | echo Text color is now random | halt }
if ((%text == rand) && (/ !iswm $1) && (! !iswm $1)) { say $random($1-) | halt }
}
alias random {
var %i = $len($1),%o
while (%i) {
%o = $+(,$gettok(02 03 04 05 06 07 10 12 13 14,$r(1,10),32),$mid($1,%i,1),%o)
dec %i
}
return %o
}
That way the user can edit the colors used by changing:
$gettok(02 03 04 05 06 07 10 12 13 14,$r(1,10),32)