I wrote a join flood protection script ages back, and it has worked properly countless times. At the time of writing it I implemented a netsplit detection system which adds nicknames that split to a hash table, and when they rejoin if they're in it, they're removed and the flood protection ignores them joining.

It has worked for some time through many netsplits, this evening it decided to not work, after absolutely no edits or anything. It kicked out coutnless people after a netsplit, and the people in them ain't happy and neither am I. This has lead me to believe that there is a bug in mIRC somewhere, and has somehow affected my script.

The code of the flood protection is below

Code:
on @*:JOIN:#:{
  if ($istok($hget(sbot,floodprosnicks),$nick,44)) { hadd -m sbot floodprosnicks $remtok($hget(sbot,floodprosnicks),$nick,1,44) | return }
  .hinc -mu2 sbot floodpro. $+ $chan
  .hadd -mu30 sbot floodpro. $+ $chan $+ .nicks $addtok($hget(sbot,floodpro. $+ $chan $+ .nicks),$nick,44)
  if ($hget(sbot,floodpro. $+ $chan) > 3) && (!$hget(sbot,floodprocheck. $+ $chan)) { 
    mode # +im
    .timer-im+R 1 30 MODE $chan -im+R
    .timer-R 1 60 MODE $chan -R
    .hadd -mu10 sbot floodprocheck. $+ $chan 1
  }
}
on *:MODE:#:{
  if ($nick == $me) && ($1 == +im) {
    sbot_ban $chan $replace($hget(sbot,floodpro. $+ $chan $+ .nicks),$chr(44),$chr(32))
    sbot_kick $chan $hget(sbot,floodpro. $+ $chan $+ .nicks) Flood
    .hdel sbot floodpro. $+ $chan $+ .nicks
  }
}
on *:QUIT:{
  if (*.*.* *.*.* iswm $1-2) {
    hadd -m sbot floodprosnicks $addtok($hget(sbot,floodprosnicks),$nick,44)
  }
}
alias -l sbot_kick {
  var %stemp $2
  while %stemp {
    .raw -q KICK $1 $gettok(%stemp,1-4,44) $+(:,$3-)
    %stemp = $deltok(%stemp,1-4,44)
  }
}
alias -l sbot_ban {
  var %stemp 1,%scurr,%sbans,%snum
  while $gettok($iif($2 isnum,$3-,$2-),%stemp,32) {
    %scurr = $ifmatch
    %sbans = $addtok(%sbans,$iif($address(%scurr,$iif($2 isnum,$2,13)),$ifmatch,%scurr),32)
    inc %stemp
  }
  while %sbans {
    %snum = $numtok(%sbans,32)
    .raw -q MODE $1 $+(+,$str(b,$iif(%snum > 6,6,%snum))) $gettok(%sbans,1-6,32)
    %sbans = $deltok(%sbans,1-6,32)
  }
}


Can someone locate an error in the code, otherwise note a bug in mIRC?

Thankyou.