Advertisement
Paladinz2k

Eggdrop Unicode spam detector

Jun 6th, 2021
3,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.56 KB | None | 0 0
  1. ## Script to detect & ban Unicode spam
  2. ##
  3. ## Based on the mIRC script by Moros
  4. ##
  5. ## Requires Eggdrop 1.8 or greater
  6. ##
  7. ## Catches channel spam such as
  8. ## /!\ ΤHIЅ CHAⲚΝЕᒪ ዘAᏚ MOᏙᎬD ТΟ ΙRϹ.ᏞIᗷЕᖇA.ⅭΗᎪT #ᎻAΜRAᗪIО /︕⧵
  9. ## ⁄ǃ\ THE ЈΕWS HᎪVE TАΚEN ΟVER FᎡEΕⲚODᎬ, CHATS HАᏙΕ ⅯΟVᎬᎠ TO ΙRⲤ.LIBΕRᎪ.CΗAΤ /!\
  10. ##
  11.  
  12. if {($version < "1.8")} { die "Eggdrop version 1.8+ required for Unicode spam detector!" }
  13.  
  14. putlog "Unicode spam detector loaded"
  15.  
  16. bind pubm - * unicodespam
  17.  
  18. proc unicodespam {nick uhost handle chan args} {
  19. global botnick
  20.  
  21. if {(![isop $botnick $chan])} { putlog "Unicode spam detected but I'm not op'd: $chan $nick $uhost $args"
  22.                                 return
  23.                               }
  24.  
  25.   if {(![isop $nick $chan]) && (![isvoice $nick $chan])} {
  26.     set count 0
  27.     set text [stripcodes bcru $args]
  28.     while {$count < 9} {
  29.     set x [string index $text $count]
  30.     set a [achr $x]
  31.     if {($a == 9834) || ($a == 9835)} { return }
  32.     if {($a > 255)} {
  33.       putlog "Unicode spam detected: $chan $nick $uhost $args"
  34.       set host [string tolower [lindex [split [getchanhost $nick $chan] @] 1]]
  35.       newchanban $chan "*!*@$host" "Unicode Spam" "Unicode Spam" 1
  36.       putserv "KICK $chan $nick :\00304(\00312<><>«\[\003 Unicode spam detected \00312\]»<><>\00304)"
  37.       set count 10
  38.       }
  39.     incr count
  40.     }
  41.   }
  42. }
  43.  
  44. proc achr {c} {
  45.   set c [string range $c 0 0]
  46.   set v 0
  47.   scan $c %c v
  48. #  return [expr $v]
  49.   return $v
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement