Advertisement
Paladinz2k

Freenode/Libera Spam Detector

Oct 30th, 2018 (edited)
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.30 KB | None | 0 0
  1. ## Script to detect & ban spam from freenode.net bots
  2. ##
  3. ## Based on the mIRC script by Moros
  4. ##
  5. ## Requires Eggdrop 1.8 or greater
  6. ##
  7.  
  8. if {($version < "1.8")} { die "Eggdrop version 1.8+ required for freenode spam detector!" }
  9.  
  10. putlog "Freenode spam detector loaded"
  11.  
  12. bind pubm - * freenodespam
  13.  
  14. proc freenodespam {nick uhost handle chan args} {
  15. global botnick
  16.  
  17. if {(![isop $botnick $chan])} { putlog "Spam detected but I'm not op'd  $chan $nick $uhost $args"
  18.                                 return
  19.                               }
  20.  
  21.   if {(![isop $nick $chan]) && (![isvoice $nick $chan])} {
  22.     set count 0
  23.     set text [stripcodes bcru $args]
  24.     while {$count < 9} {
  25.     set x [string index $text $count]
  26.     set a [achr $x]
  27.     if {($a == 9834) || ($a == 9835)} { return }
  28.     if {($a > 255)} {
  29.       putlog "Spam detected $chan $nick $uhost $args"
  30.       set host [string tolower [lindex [split [getchanhost $nick $chan] @] 1]]
  31.       newchanban $chan "*!*@$host" "Libera Spam" "Libera Spam" 1
  32.       putserv "KICK $chan $nick :\00304(\00312<><>«\[\003 Do NOT advertise other channels or websites here. \00312\]»<><>\00304)"
  33.       set count 10
  34.       }
  35.     incr count
  36.     }
  37.   }
  38. }
  39.  
  40. proc achr {c} {
  41.   set c [string range $c 0 0]
  42.   set v 0
  43.   scan $c %c v
  44. #  return [expr $v]
  45.   return $v
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement