alias jflood {
.hadd -m jf join-max 2
.hadd -m jf time-max 3
.hadd -m jf kick-text Stop Join Flood!
;---------------------
;# Type 1 = nick!ident@host
;# Type 2 = nick!*@host
;# Type 3 = *!ident@host
;# Type 4 = nick!*@*
;# Type 5 = *!ident@*
;# Type 6 = *!*@host
;# Type 7 = *!*@subnet*
;---------------------
.hadd -m jf type-ban 7
}
on *:JOIN:#:{
jflood | var %jf_chan $+(jfchan-,$chan) | var %jf_nick $+(jfnick-,$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 | .hadd -m %jf_nick %jf_ip $nick }
.echo $chan 04JFLOOD: >>> $hget(%jf_nick,%jf_ip) $+($chr(40),%jf_ip,$chr(41)) = $+(04,$hget(%jf_chan,%jf_ip))
if ($hget(%jf_chan,%jf_ip) >= $hget(jf,join-max)) {
;---------------------
if ($hget(jf,type-ban) == 1) .mode $chan +b $address($hget(%jf_nick,%jf_ip),5)
if ($hget(jf,type-ban) == 2) .mode $chan +b $address($hget(%jf_nick,%jf_ip),7)
if ($hget(jf,type-ban) == 3) .mode $chan +b $address($hget(%jf_nick,%jf_ip),0)
if ($hget(jf,type-ban) == 4) .mode $chan +b $+($hget(%jf_nick,%jf_ip),!*@*)
if ($hget(jf,type-ban) == 5) .mode $chan +b $+($gettok($address($hget(%jf_nick,%jf_ip),1),1,64),@*)
if ($hget(jf,type-ban) == 6) .mode $chan +b $address($hget(%jf_nick,%jf_ip),2)
if ($hget(jf,type-ban) == 7) .mode $chan +b $+(*!*@,$gettok(%jf_ip,1-2,46),.*)
;---------------------
.kick $chan $hget(%jf_nick,%jf_ip) $hget(jf,kick-text)
.hdel -sw %jf_chan %jf_ip
}
}