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.

Need little help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
C
CadeFoster
Voice
Posts: 5
Joined: Mon Nov 20, 2006 8:00 pm

Need little help

Post by CadeFoster »

Hello. I need little help with this tcl

Code: Select all

### 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..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Search the Tcl Archive, there are plenty of antispam scripts.
C
CadeFoster
Voice
Posts: 5
Joined: Mon Nov 20, 2006 8:00 pm

Post by CadeFoster »

yeah... I know.. but I wanna know if have some way to edit this tcl.. please help...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

add these lines to the script:

Code: Select all

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
 }
}
C
CadeFoster
Voice
Posts: 5
Joined: Mon Nov 20, 2006 8:00 pm

Post by CadeFoster »

Thank You Sir_Fz ...
Post Reply