Advertisement
westor

Join Flood Protection for Kendy v1.3

Jul 18th, 2020
1,836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.40 KB | None | 0 0
  1. ; ---- Settings ----
  2. alias -l channel { return # }
  3. alias -l times { return 3 }
  4. alias -l secs { return 3 }
  5. alias -l modes { return impsCMRF }
  6. alias -l modes_secs { return 360 }
  7. alias -l ban_secs { return 300 }
  8. alias -l ban_type { return 2 }
  9. alias -l ban_msg { return Join Flooding }
  10. ; ---- Settings ----
  11.  
  12. ON @!*:JOIN:$($channel): { .timer[CHECK_ $+ $nick $+ _ $+ $chan $+ _JOIN] 1 1 chk_all_status $nick $chan }
  13.  
  14. alias chk_all_status {
  15.   if (!$1) && (!$2) && ($status !== connected) && ($me !isop $2) && ($me !ison $2) && ($1 !ison $2) && ($1 !isreg $2) { return }
  16.  
  17.   inc $+(-eu,$secs) $+(%,flood,_,join,_,$2) 1
  18.   set $+(-eu,$secs) $+(%,flood,_,join,_,$2,_,nicks) $addtok($evalnext($+(%,flood,_,join,_,$2,_,nicks)),$1,32)
  19.  
  20.   if ($evalnext($+(%,flood,_,join,_,$2)) == $times) {
  21.     unset $+(%,flood,_,join,_,$2)
  22.  
  23.     mode $2 $+(+,$modes)
  24.     .timer[REMOVE_ $+ $1 $+ _MODES] 1 $modes_secs mode $2 $+(-,$modes)
  25.  
  26.     bk_all $2
  27.   }
  28.  
  29. }
  30.  
  31. alias -l bk_all {
  32.   if (!$1) { return }
  33.  
  34.   var %t = $evalnext($+(%,flood,_,join,_,$1,_,nicks))
  35.  
  36.   if (!%t) { return }
  37.  
  38.   var %i = 1
  39.   while (%i <= $numtok(%t,32)) {
  40.     var %n = $gettok(%t,%i,32)
  41.  
  42.     if (!%n) { goto next }
  43.     if (%n !ison $1) || (%n !isreg $1) { set $+(%,flood,_,join,_,$1,_,nicks) $remtok($evalnext($+(%,flood,_,join,_,$1,_,nicks)),%n,1,32) | goto next }
  44.  
  45.     ban $+(-ku,$ban_secs) $1 %n $ban_type $ban_msg
  46.  
  47.     set $+(%,flood,_,join,_,$1,_,nicks) $remtok($evalnext($+(%,flood,_,join,_,$1,_,nicks)),%n,1,32)
  48.  
  49.     :next
  50.     inc %i
  51.   }
  52.  
  53.   unset $+(%,flood,_,join,_,$1,_,nicks)
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement