As its previous version did, this snippet goes in remotes (alt-R).
Usage:
/mass [op|deop|voice|devoice] nick1 nick2 nick3 nick4 nick5...
(Will op, deop, voice or devoice the specified nicks.)
/mass [op|deop|voice|devoice] -e nick1 nick2 nick3 nick4 nick5...
(Will op, deop, voice or devoice everybody but the specified nicks.)
/mass [op|deop|voice|devoice] -a
(Will op, deop, voice or devoice everybody.)
The /mass command will not affect you when you type it (except if you deliberately include your nick in the base version of the command), so, for instance, even if you deop everybody via the command you will stay opped.
alias mass { var %mp = $gettok($mstring($1),1,32) var %m = $gettok($mstring($1),2,32) var %o = $numtok($2-,32) if ($2 == -e) { var %no = $3- if (%m == v) { if (%mp == +) { var %mm = oh } elseif (%mp == -) { var %mm = ohr } } if (%m == o) { if (%mp == +) { var %mm = o } elseif (%mp == -) { var %mm = vhr } } var %v = $nick($chan,0,a,%mm) while (%v) { if (!$istok(%no,$nick($chan,%v,a,%mm),32)) && ($nick($chan,%v,a,%mm) != $me) { var %vn = %vn $nick($chan,%v,a,%mm) } if ($numtok(%vn,32) == $modespl) { mode $chan $+(%mp,$str(%m,$ifmatch)) unset %vn } dec %v } if (%vn) { mode $chan $+(%mp,$str(%m,$numtok(%vn,32))) %vn } } elseif ($2 == -a) { if (%m == v) { if (%mp == +) { var %mm = oh } elseif (%mp == -) { var %mm = ohr } } if (%m == o) { if (%mp == +) { var %mm = o } elseif (%mp == -) { var %mm = vhr } } var %v = $nick($chan,0,a,%mm) while (%v) { if ($nick($chan,%v,a,%mm) != $me) { var %vn = %vn $nick($chan,%v,a,%mm) } if ($numtok(%vn,32) == $modespl) { mode $chan $+(%mp,$str(%m,$ifmatch)) %vn unset %vn } dec %v } if (%vn) { mode $chan $+(%mp,$str(%m,$numtok(%vn,32))) %vn } } else { if (%o <= $modespl) { mode $chan $+(%mp,$str(%m,%o)) $2- } else { var %on = $2- while %o { tokenize 32 %on mode $chan $+(%mp,$str(%m,$modespl)) $($+($,1-,$modespl),2) var %on = $deltok(%on,$+(1,-,$modespl),32) var %o = $numtok(%on,32) } } } }
alias -l mstring { if ($1 = op) { return + o } if ($1 = deop) { return - o } if ($1 = voice) { return + v } if ($1 = devoice) { return - v } }