On rawmode
From Scriptwiki
The on RAWMODE event triggers independently of mode,op,voice,ban,etc. events and allows you to parse the raw mode line yourself.
on <level>:RAWMODE:<#[,#]>:<commands>
Example
on *:rawmode:#:{ echo $chan $nick sets mode: $1- on $chan }