egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Anti spam

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
asdd1
Voice


Joined: 05 Jul 2008
Posts: 23

PostPosted: Wed Jul 09, 2008 5:57 am    Post subject: Anti spam Reply with quote

Why it doesn't detect spam? Sad

Code:

### 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
}
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jul 09, 2008 6:07 am    Post subject: Reply with quote

The proc looks like a pubm proc and not msgm. Try replacing msgm with pubm.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
asdd1
Voice


Joined: 05 Jul 2008
Posts: 23

PostPosted: Wed Jul 09, 2008 6:11 am    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jul 09, 2008 6:51 am    Post subject: Reply with quote

It is easier to just use a different script which contains the features you need.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
asdd1
Voice


Joined: 05 Jul 2008
Posts: 23

PostPosted: Wed Jul 09, 2008 6:57 am    Post subject: Reply with quote

Sir_Fz wrote:
It is easier to just use a different script which contains the features you need.


I cant find different script Sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber