Once I found a good flooding routine. Unfortunatey I don't know the name of the guy who wrote it, but he earns the credits! The routine is:
alias isflood {
;Call this identifier each time you want to check if there is a flood, for example
;on *:JOIN:*: if ($isflood(joinflood,5,3)) { mode # +i }
; $1 - name eg "joinflood"
; $2 - times (in how many seconds)
; $3 - seconds
;If not enough parameters, return
if (!$3) return
var %v = $chr(37) $+ isflood. $+ $1
;If the var doesnt exist
if !$(%v,2) {
;Set it to 1
set $(-u $+ $3,2) $(%v,1) 1
}
else {
;Else increment the var
inc $(%v,1)
}
;If the var is more than or equal to what you specified (times)
if $(%v,2) >= $2 {
;Unset the variable so it doesnt continually return true
unset $(%v,1)
return $true
}
; If it is not triggered return false
return $false
}
Suppose you want to ban somebody for an hour who was kicked 3 times in 60 secs, you could do the following:
on *:KICK:#: {
if ($isflood(kicked $+ $chan $+ $nick, 3, 60)) {
ban -ku3600 $chan <nickname|address> [type]
}
....
}
Fill in the nickname or the address depending on the type of ban you want. You could also substitute the $nick part in if ($isflood... by an address if you like, to prevent nickname change.