This works well when I tried it

Code:
on *:text:!endriot:#: {
  if ($nick !isop #) { return }
  msg $chan The RIOT has ENDED! Calm your spam!
  hsave -n table file.tmp
  filter -ffcuten 2 32 file.tmp file.tmp
  var %i = 10
  var %y = 1
  msg # The top 10 spammers:
  while (%i) {
    if ($hget(table,$gettok($read(file.tmp,%i),1,32)).item) {
      .timer 1 %y msg # %i $+ : $hget(table,$gettok($read(file.tmp,%i),1,32)).item    
    }
    dec %i
    inc %y   
  }
  set %riot false
  hfree table
}

on *:text:!startriot:#: {
  if ($nick !isop #) { return }
  msg $chan The RIOT has BEGUN! Spam your way to the top!
  set %riot true
  hmake table
}
on *:text:*:#:{
  if (%riot != true) { return } 
  if (!$hget(table,$nick)) {
    hadd table $nick 1
  }
  else {
    hadd table $nick $calc($hget(table,$nick)+1)
  }
}