Just a suggestion - I'd use "random" hash table items instead.
Personally, I dislike timers like "inc -uN" for protections etc, as they were "restarted" on every deop. (likely to named timers: every time they were triggered before they are "done", the unset period is reset. Flood protection scripts etc often have the same issue...) smile

Well, xDaeMoN escaped this source of error, but many scripts dont. frown

This is watching deops in general (disregarding the nick):
Code:
on *:deop:#: {
  var %timeout = 30, %limit = 3
  hadd $+(-mu,%timeout) $+(deop.,$network,.,$chan) $rand(1,999)
  if ($hfind($+(deop.,$network,.,$chan),*,0,w) > %limit) {
    echo -a more than %limit deops in %timeout seconds on $chan detected
  }
}

If you want to detect deops by a single nick, you can add e.g. the nickname as data for the hashtable item, and use $hfind().data:
Code:
on *:deop:#: {
  var %timeout = 30, %limit = 3
  hadd $+(-mu,%timeout) $+(deop.,$network,.,$chan) $rand(1,999) $nick
  if ($hfind($+(deop.,$network,.,$chan),$nick,0,w).data > %limit) {
    echo -a more than %limit deops in %timeout seconds by $nick on $chan detected
  }
}


Edit: if it's not about flood protection (and in this case it's not), $ticks would be as good as a random number for the item name of the hash table.