rainbow isnt just 2 colors it's 7 but as u like i dont know :)
use menu * is not a good idea u may have a picwin game and this will be appear into menu!! so, better to use menu status,channel,query,nicklist,menubar
you can use $regsubex, u dont have to repeat "Turn Raindows on/off", and variable can be 1 or 0 to return true or false so your code can be like this
menu status,channel,query,nicklist,menubar {
Turn Rainbows $iif(%rainbows,On,Off) : set %rainbows $iif(%rainbows,0,1)
}
on *:input:*:{
if ($left($1-,1) != / && %rainbows) {
haltdef
msg $active $regsubex($1-,/([^\s])/g,$+($chr(3),$gettok(4 12,$r(1,2),32),\t))
}
}
Sorry for my accent because i don't speak English well
@Firstmate on "$vget(test,$me,0)" this will return %testSavage0 but the variable is without the "0" just %testSavage
and look at his code "if %name exist return %name else echo -ea %name is not set!" so when u use return to both the variable can be "Variable not set." and noting will be returned on active window
@Fuzionx wtf are you saying!! did you think twice before telling me this dumb story?
hi
i think no need to loop u can do it like this also
alias vget {
if (!$2) { echo -ea invalid parameters! | HALT }
var %x $iif($0 = 4,$1-3,$1-2)
if $(% $+ $replace(%x,$chr(32),$chr($(,$+($,$0)))),2) { return $v1 }
else { echo 7 -ae % $+ $replace(%x,$chr(32),$chr($(,$+($,$0)))) is not set! }
}
P.S: this is just an E.G not tested yet only to give some idea