on $*:text:/^!groups$/iS:#:msg # [Group] Alpha $numtok(%alpha,32) users [Group] Beta $numtok(%beta,32) users
on $*:text:/^!add\b/iS:#:{
tokenize 32 $strip($1-)
; remove the else branch, since you can expect it not to be executed most of the time.
var %g1, %g2
if ($2 == alpha || $2 == beta) {
goto $2
}
msg # Group nonexistent. Use: !add alpha or !add beta
return
:alpha
set %alpha $addtok(%alpha,$nick,32)
set %beta $remtok(%beta,$nick,1,32)
goto end
:beta
set %alpha $remtok(%alpha,$nick,1,32)
set %beta $remtok(%beta,$nick,32)
goto end
:end
notice $nick You are in the $2 group
}