Advertisement
westor

Repeat Char Protection for Kendy v1.2

Jan 19th, 2021 (edited)
2,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.79 KB | None | 0 0
  1. alias -l ban_nick_time { return 120 } ; 120 = seconds
  2. alias -l ban_type { return 2 } ; /help $mask for more ban types
  3. alias -l ban_nicks_exceptions { return PC Kendy BotServ PC1 }
  4. alias -l ban_chars_match_limit { return 4 } ; 4 = chars to match, eg: "hiiii" will match
  5. alias -l ban_chars_match_case_insensitive { return 1 } ; 1 = will match on "HiIIiIiIIiI" , use 0 to disable it
  6.  
  7. #repeatchar on
  8.  
  9. ; Regex made by maroon
  10. ON @*:TEXT:*:#: {
  11.   tokenize 32 $strip($1-)
  12.  
  13.   var %p = /\b(\S*(.)\2{ $+ $calc($ban_chars_match_limit - 1) $+ })\b/ $+ $iif($ban_chars_match_case_insensitive,i)
  14.  
  15.   if ($regex($1-,%p)) { rp_check $nick $chan $regml(1) }
  16. }
  17.  
  18. ON @$*:ACTION:/\b(\S*(.)\2{5})\b/iS:#: {
  19.   tokenize 32 $strip($1-)
  20.  
  21.   var %p = /\b(\S*(.)\2{ $+ $calc($ban_chars_match_limit - 1) $+ })\b/ $+ $iif($ban_chars_match_case_insensitive,i)
  22.  
  23.   if ($regex($1-,%p)) { rp_check $nick $chan $regml(1) }
  24. }
  25.  
  26. alias -l rp_check {
  27.   if (!$1) || (!$2) || (!$3) || ($me !ison $2) || ($1 !ison $2) || ($1 !isreg $2) || ($istok($ban_nicks_exceptions,$1,32)) { return }
  28.  
  29.   inc %knum 1
  30.  
  31.   ban $+(-ku,$ban_nick_time) $2 $1 $ban_type 4[Banned] (reason: Do NOT repeat letters/words/emotions/symbols/characters/numbers/blanks ( $+ $3- $+ ) in this channel -- for more information regarding your ban please contact nickname Kendy for removal -13- [Kick id: $chr(35) $+ %knum $+ ] (Expires in: $duration($ban_nick_time) $+ )
  32. }
  33.  
  34. #repeatchar end
  35.  
  36. menu channel,status,query,menubar {
  37.   -
  38.   [26] Repeat Character Kick Ban [hiiiiii] ( $+ $upper($group(#repeatchar)) $+ )
  39.   .$iif($group(#repeatchar) == On,$style(3)) On: { .enable #repeatchar | echo -a *** 4Repeat Char detected is now ON }
  40.   .-
  41.   .$iif($group(#repeatchar) == Off,$style(3)) Off: { .disable #repeatchar | echo -a *** 4Repeat Char detected is now OFF }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement