on *:RAWMODE:#: {
var %modes = $remove($1,-,+)
var %x = $numtok($2-,32)
while (%x) {
var %i = $len(%modes)
while (%i) {
if ([color:red]q[/color] == $mid(%modes,%i,1) && ($left($1,1) == -) {
if ($gettok($2-,%i,32) isop $chan) { cline 12 # $gettok($2-,%i,32) }
elseif ($gettok($2-,%x,32) ishop $chan) { cline 11 # $gettok($2-,%x,32) }
elseif ($gettok($2-,%x,32) isvoice $chan) { cline 3 # $gettok($2-,%x,32) }
else { cline UOP Color # $gettok($2-,%x,32) }
}
if ([color:red]q[/color] == $mid(%modes,%i,1) && ($left($1,1) == +) {
if ($gettok($2-,%x,32) isop $chan) { cline 12 # $$gettok($2-,%x,32) }
elseif ($gettok($2-,%x,32) ishop $chan) { cline 11 # $$gettok($2-,%x,32) }
elseif ($gettok($2-,%x,32) isvoice $chan) { cline 3 # $$gettok($2-,%x,32) }
else { cline UOP Color # $gettok($2-,%x,32) }
}
dec %i
}
dec %x
}
}