Advertisement
westor

Similar Word Protection for Debian v1.1

Oct 17th, 2020 (edited)
3,026
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.93 KB | None | 1 0
  1. alias -l channel { return #prova }
  2. alias -l min_words { return 5 }
  3. alias -l min_text_length { return 25 }
  4. alias -l unset_word_seconds { return 30 }
  5. alias -l except_nicks { return nick1 nick2 nick3 }
  6.  
  7. #swp on
  8. ON @*:TEXT:*:$($channel): { check_flood $nick $chan $strip($1-) }
  9. ON @*:ACTION:*:$($channel): { check_flood $nick $chan $strip($1-) }
  10. #swp end
  11.  
  12. alias -l check_flood {
  13.   if (!$1) || (!$2) || (!$3) { return }
  14.  
  15.   var %o = $ial($1).host
  16.   var %e = $ctime
  17.   var %h = SWP_ $+ $2
  18.   var %t = $numtok($3-,32)
  19.  
  20.   if (%t < 5) { return }
  21.   if ($istok($except_nicks,$1,32)) { return }
  22.   if ($len($3-) < $min_text_length) { return }
  23.  
  24.   var %i = 1
  25.   while (%i <= %t) {
  26.     var %w = $gettok($3-,%i,32)
  27.     var %p = $hget(%h,%w)
  28.  
  29.     if (%p) && (%p !== %e) { var %ban = 1 }
  30.  
  31.     hadd $+(-mu,$unset_word_seconds) %h %w %e
  32.  
  33.     inc %i
  34.   }
  35.  
  36.   if (%ban) { mode $2 +b *!*@*. $+ $gettok(%o,$calc($numtok(%o,46) -1) $+ -,46) }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement