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 

Need little help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
CadeFoster
Voice


Joined: 20 Nov 2006
Posts: 5

PostPosted: Mon Nov 20, 2006 8:10 pm    Post subject: Need little help Reply with quote

Hello. I need little help with this tcl
Code:
### Set Bad Words that you want the Bot to Kick on
set advwords {
blq
blq blq
blq blq blq
}

### Set Words that you want the Bot to EXEMPT (Dont count as spam)
set advexemptwords {
"apniisp"
"#channel"
}

### Set Your Ban Reason
set advreason "Some Reason"

### Set Ban Time
set advduration 24h

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


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 Public Messages to our Process
bind pubm - * filter_advertisement

## Starting Process
proc filter_advertisement {nick uhost handle channel args} {
 global advwords advreason banmask botnick advduration advexemptwords
  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 *$advword* [string tolower $args]]}  {
        foreach advexemptword [string tolower $advexemptwords] {     
          if {![string match *$advexemptword* [string tolower $args]]}  {
            if {[matchattr $handle +f]} {
              putlog "Protected: $nick ($handle) "
            } elseif {[matchattr $handle +o]} {
              putlog "Protected: $nick ($handle) "
            } else {
              putlog "KICKED $nick matched by $args"
              putquick "KICK $nick :$advreason"
            }
          }
        }
      }
    }
}

bind pubm - * filter_advertisement

The tcl work good.. but he detect the word only when they are public msg. I wanna make the tcl to detect the word in NOTICE, PRIVATE , PART MSG, ACTION. If anyone know how to do this..
thanks in advanced..
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Nov 20, 2006 8:54 pm    Post subject: Reply with quote

Search the Tcl Archive, there are plenty of antispam scripts.
_________________
Follow me on GitHub

- Opposing

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


Joined: 20 Nov 2006
Posts: 5

PostPosted: Tue Nov 21, 2006 7:31 am    Post subject: Reply with quote

yeah... I know.. but I wanna know if have some way to edit this tcl.. please help...
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Nov 21, 2006 10:39 am    Post subject: Reply with quote

add these lines to the script:
Code:
bind notc - * notc:adv
bind ctcp - ACTION act:adv
bind part - * part:adv
bind msgm - * msg:adv

proc notc:adv {n u h a c} {
 filter_advertisement $n $u $h $c $a
}

proc act:adv {n u h c kw a} {
 filter_advertisement $n $u $h $c $a
}

proc part:adv {n u h c a} {
 filter_advertisement $n $u $h $c $a
}

proc msg:adv {n u h a} {
 foreach c [channels] {
  filter_advertisement $n $u $h $c $a
 }
}

_________________
Follow me on GitHub

- Opposing

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


Joined: 20 Nov 2006
Posts: 5

PostPosted: Tue Nov 21, 2006 7:48 pm    Post subject: Reply with quote

Thank You Sir_Fz ...
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 Requests 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