Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l channel { return #prova }
- alias -l min_words { return 5 }
- alias -l min_text_length { return 25 }
- alias -l unset_word_seconds { return 30 }
- alias -l except_nicks { return nick1 nick2 nick3 }
- #swp on
- ON @*:TEXT:*:$($channel): { check_flood $nick $chan $strip($1-) }
- ON @*:ACTION:*:$($channel): { check_flood $nick $chan $strip($1-) }
- #swp end
- alias -l check_flood {
- if (!$1) || (!$2) || (!$3) { return }
- var %o = $ial($1).host
- var %e = $ctime
- var %h = SWP_ $+ $2
- var %t = $numtok($3-,32)
- if (%t < 5) { return }
- if ($istok($except_nicks,$1,32)) { return }
- if ($len($3-) < $min_text_length) { return }
- var %i = 1
- while (%i <= %t) {
- var %w = $gettok($3-,%i,32)
- var %p = $hget(%h,%w)
- if (%p) && (%p !== %e) { var %ban = 1 }
- hadd $+(-mu,$unset_word_seconds) %h %w %e
- inc %i
- }
- if (%ban) { mode $2 +b *!*@*. $+ $gettok(%o,$calc($numtok(%o,46) -1) $+ -,46) }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement