checkop {
;$1 is the name of the chan
if ($me isop $1) {
set %i $line($1,0,1) | set %op
while (%i > 0) {
if ($line($1,%i,1) !isop $1) { set %op $addtok(%op,$line($1,%i,1),46) }
dec %i
}
while ($numtok(%op,46) > 0) {
mode $1 +o $gettok(%op,$numtok(%op,46),46)
set %op $deltok(%op,$numtok(%op,46),46)
}
unset %i | unset %op
}
}