A series of commands to load on a bot, that allow all ops in the channel to ban, kickban, set topic, etc. simply typing a !command.
Commands available are: !topic, !kick, !ban, !kickban, !mode, !op, !deop, !voice, !devoice, !voiceall, !devoiceall.
The latter two commands use $modespl, along with tokens and $str, to voice/devoice as many people as possible on the same line (to avoid the channel getting flooded by mode changes).
ON @*:TEXT:*:#: {
if ($nick isop $chan) {
if ($1 == !topic) {
topic $chan $2-
}
if ($1 == !kick) {
kick $chan $2 $3-
}
if ($1 == !ban) {
ban $chan $address($2,3)
}
if ($1 == !kickban) {
ban -k $chan $2 3 $3-
}
if ($1 == !mode) {
mode $chan $2-
}
if ($1 == !op) {
mode $chan +o $2
}
if ($1 == !deop) {
mode $chan -o $2
}
if ($1 == !voice) {
mode $chan +v $2
}
if ($1 == !devoice) {
mode $chan -v $2
}
if ($1 == !voiceall) {
var %v = $nick($chan,0,r)
while (%v) {
var %vn = %vn $nick($chan,%v,r)
if ($numtok(%vn,32) == $modespl) {
mode $chan $+(+,$str(v,$ifmatch))
unset %vn
}
dec %v
}
if (%vn) {
mode $chan $+(+,$str(v,$numtok(%vn,32))) %vn
}
}
if ($1 == !devoiceall) {
var %v = $nick($chan,0,v)
while (%v) {
var %vn = %vn $nick($chan,%v,v)
if ($numtok(%vn,32) == $modespl) {
mode $chan $+(-,$str(v,$ifmatch))
unset %vn
}
dec %v
}
if (%vn) {
mode $chan $+(-,$str(v,$numtok(%vn,32))) %vn
}
}
}
}