alias jflood {
.hadd -m jf join-max 2
.hadd -m jf time-max 4
.hadd -m jf kick-text Stop Join Flood!
}
on *:JOIN:#:{
jflood | var %jf_chan $+(jfchan-,$chan) | var %jf_ip $gettok($address($nick,5),2,64)
if ($hget(%jf_chan,%jf_ip)) .hinc -m %jf_chan %jf_ip 1
if (!$hget(%jf_chan,%jf_ip)) .hadd -mu $+ $hget(jf,time-max) %jf_chan %jf_ip 1
.echo $chan 04JFLOOD: >>> %jf_ip = $+(04,$hget(%jf_chan,%jf_ip))
if ($hget(%jf_chan,%jf_ip) >= $hget(jf,join-max)) {
;------------------------------
;# ban only one ip
;.mode $chan +b $+(*!*@,%jf_ip)
;# ban subnet ip
.mode $chan +b $+(*!*@,$gettok(%jf_ip,1-2,46),.*)
;------------------------------
.kick $chan $nick $hget(jf,kick-text)
.hdel -sw %jf_chan %jf_ip
}
}