Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Script to detect & ban spam from freenode.net bots
- ##
- ## Based on the mIRC script by Moros
- ##
- ## Requires Eggdrop 1.8 or greater
- ##
- if {($version < "1.8")} { die "Eggdrop version 1.8+ required for freenode spam detector!" }
- putlog "Freenode spam detector loaded"
- bind pubm - * freenodespam
- proc freenodespam {nick uhost handle chan args} {
- global botnick
- if {(![isop $botnick $chan])} { putlog "Spam detected but I'm not op'd $chan $nick $uhost $args"
- return
- }
- if {(![isop $nick $chan]) && (![isvoice $nick $chan])} {
- set count 0
- set text [stripcodes bcru $args]
- while {$count < 9} {
- set x [string index $text $count]
- set a [achr $x]
- if {($a == 9834) || ($a == 9835)} { return }
- if {($a > 255)} {
- putlog "Spam detected $chan $nick $uhost $args"
- set host [string tolower [lindex [split [getchanhost $nick $chan] @] 1]]
- newchanban $chan "*!*@$host" "Libera Spam" "Libera Spam" 1
- putserv "KICK $chan $nick :\00304(\00312<><>«\[\003 Do NOT advertise other channels or websites here. \00312\]»<><>\00304)"
- set count 10
- }
- incr count
- }
- }
- }
- proc achr {c} {
- set c [string range $c 0 0]
- set v 0
- scan $c %c v
- # return [expr $v]
- return $v
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement