This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Anti spam

Support & discussion of released scripts, and announcements of new releases.
Post Reply
a
asdd1
Voice
Posts: 23
Joined: Sat Jul 05, 2008 6:33 am

Anti spam

Post by asdd1 »

Why it doesn't detect spam? :(

Code: Select all

### Features:
# * Sets a 2 Minute Channel ban on user who writes any of the
#   defined words
# * Doesn't ban users with +o OR +f flags
# * Logs ALL user/op messages containing the defined words
# * Strips Character Codes from Messages

### Set Advertising Words that you want the Bot to Kick on
set advwords { 
"http:*"
"www.*.co"
"www.*.net"
"www.*.org"
"www.*.info"
"#???*"
"*http://www.netwars.ru/go.php?login=*"                  
"*netwars.ru*"                                           
"*http://domain.com*"                                    
"*http://*"                                              
"*www*"                                                  
"*#*"                                                    
}
set timecycle 1
### Set Advertising Words that you want the Bot to EXEMPT (Dont count as spam)
set advexemptwords { 
"apniisp"
"#masti"
}

### Set Your Ban Reason
set advreason "Spam not allowed here"

### Set Ban Time
set advduration 1h

### Begin Script:
## (Don't change anything below here... Unless you know tcl)


### Borrowed from awyeahs tcl scripts (www.awyeah.org) ###
## awyeah said: Thanks to user and ppslim for this control code removing filter
proc ccodes:filter {str} {
  regsub -all -- {\003([0-9]{1,2}(,[0-9]{1,2})?)?|\017|\037|\002|\026|\006|\007} $str "" str
  return $str
}

## Binding all Private Messages to our Process
bind msgm - "*" filter_advertisement

## Starting Process
proc filter_advertisement {nick uhost handle channel args} {
 global advwords advreason banmask botnick advduration advexemptwords cycletime
  set args [ccodes:filter $args]
  set handle [nick2hand $nick]
  set banmask "*![lindex [split $uhost @] 0]@[lindex [split $uhost @] 1]" 
    foreach advword [string tolower $advwords] {
      if {[string match -nocase *$advword* [string tolower $args]]}  {
        foreach advexemptword [string tolower $advexemptwords] {     
          if {![string match -nocase *$advexemptword* [string tolower $args]]}  {
            if {[matchattr $handle +f]} {
              putlog "-Anti Advertise Script- $nick ($handle) with +f flags said $args on $channel"
            } elseif {[matchattr $handle +o]} {
              putlog "-Anti Advertise Script- $nick ($handle) with +o flags said $args on $channel"
            } else {
              putlog "-Anti Advertise Script- KICKED $nick on $channel matched by $args"
              putquick "KICK $channel $nick :$advreason"
              newchanban $channel $banmask $botnick $advreason $advduration
            }
          }
        }
      }
    }
}

timer $timecycle part_chan

proc part_chan {} {
   global timecycle
   foreach chancycle [channels] {
      putserv "PART $chancycle"
   }
   timer $timecycle part_chan
}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The proc looks like a pubm proc and not msgm. Try replacing msgm with pubm.
a
asdd1
Voice
Posts: 23
Joined: Sat Jul 05, 2008 6:33 am

Post by asdd1 »

Sir_Fz wrote:The proc looks like a pubm proc and not msgm. Try replacing msgm with pubm.
Replaced with pubm, it's okay.
How to edit it to work with msgm ?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

It is easier to just use a different script which contains the features you need.
a
asdd1
Voice
Posts: 23
Joined: Sat Jul 05, 2008 6:33 am

Post by asdd1 »

Sir_Fz wrote:It is easier to just use a different script which contains the features you need.
I cant find different script :(
Post Reply