menu nicklist {
Common Channels
.Op : common op $snicks
.Deop : common deop $snicks
.Half-Op : common hop $snicks
.DeHalf-Op : common dehop $snicks
.Voice : common voice $snicks
.Devoice : common devoice $snicks
}
alias common {
var %a = 1, %b = $numtok($2,44)
while %a <= %b {
var %nick = $gettok($2,%a,44)
var %c = 1, %d = $comchan(%nick,0)
while %c <= %d {
var %chan = $comchan(%nick,%c)
if ($me isop %chan) {
if ($2 == op) && (%nick !isop %chan) { .mode %chan +o %nick }
elseif ($2 == deop) && (%nick isop %chan) { .mode %chan -o %nick }
elseif ($2 == hop) && (%nick !ishelp %chan) { .mode %chan +h %nick }
elseif ($2 == dehop) && (%nick ishelp %chan) { .mode %chan -h %nick }
elseif ($2 == voice) && (%nick !isvoice %chan) { .mode %chan +v %nick }
elseif ($2 == devoice) && (%nick isvoice %chan) { .mode %chan -v %nick }
}
inc %c
}
inc %a
}
}