ON @*:TEXT:*:#:{
var %flood = $flood(1,2,5,$chan,$nick,txtflood)
if (%flood) {
var %fl = $gettok(%flood,1,46)
var %ft = $gettok(%flood,2,46)
ban -u60 $chan $nick 2
kick $chan $nick Please stop flooding ( $+ $+(%fl,lines/,%ft,secs) $+ )
return
}
var %repeat = $repeat(1,4,60,$chan,$nick,repeat,$1-)
if (%repeat) {
var %rl = $gettok(%repeat,1,46)
var %rt = $gettok(%repeat,2,46)
ban -u60 $chan $nick
kick $chan $nick Stop! repeating...( $+ $+(%rl,repeats/,%rt,secs) $+ )
return
}
}
;FLOOD ALIAS
alias flood {
if ($hget($+(prot.,$cid,.,$4)) != $+(prot.,$cid,.,$4)) hmake $+(prot.,$cid,.,$4) 1500
var %h = $+(prot.,$cid,.,$4)
var %h1 = $+($6,.,$5)
var %h3 = $hget(%h,%h1)
if (%h3) {
var %counts = $gettok(%h3,1,46)
var %c = $gettok(%h3,2,46)
var %ct = $calc($ctime - $gettok(%h3,2,46))
hadd -u [ $+ [ $calc($3 - %ct) ] ] %h %h1 $+($calc(%counts + $1),.,%c)
if ($calc(%counts + 1) > $2) { return $+($gettok($hget(%h,%h1),1,46),.,$calc($ctime - $gettok($hget(%h,%h1),2,46))) }
}
else { hadd -u [ $+ [ $3 ] ] %h %h1 $+($1,.,$ctime) }
}
;REPEAT ALIAS
alias repeat {
var %t = $hash($strip($7-),32)
if ($hget($+(prot.,$cid,.,$4)) != $+(prot.,$cid,.,$4)) hmake $+(prot.,$cid,.,$4) 1500
var %h = $+(prot.,$cid,.,$4)
var %h1 = $+($6,.,$5)
var %h3 = $hget(%h,%h1)
if (%h3) {
var %last.text = $gettok(%h3,3,46)
if (%t == %last.text) {
var %counts = $gettok(%h3,1,46)
var %inccounts = $calc(%counts + 1)
}
elseif (%t != %last.text) {
var %inccounts = 1
}
var %c = $gettok(%h3,2,46)
var %ct = $calc($ctime - $gettok(%h3,2,46))
hadd -u [ $+ [ $calc($3 - %ct) ] ] %h %h1 $+(%inccounts,.,%c,.,%t)
if ($calc(%counts + $1) >= $2) { return $+($gettok($hget(%h,%h1),1,46),.,$calc($ctime - $gettok($hget(%h,%h1),2,46))) }
}
else { hadd -u [ $+ [ $3 ] ] %h %h1 $+($1,.,$ctime,.,%t) }
}