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.

Help with a script.

Old posts that have not been replied to for several years.
Locked
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Help with a script.

Post by Sir_Fz »

Code: Select all

set spambantime 10

bind msgm - "*" pv_kick


proc pv_kick {nick uhost hand text} {
global botnick spambantime

 if {[matchattr $hand m]} { return }
 if {[regexp -nocase "#" $text] || [regexp -nocase "join" $text] || [regexp -nocase "channel" $text] || [regex$
   foreach kickchan [channels] {
     if {![isop $nick $kickchan] || ![isvoice $nick $kickchan]} {
       if {[onchan $nick $kickchan]} {
          set bmask "*!*[string range $uhost [string first "@" $uhost] end]"
          if {![ischanban $bmask $kickchan] || [botisop $kickchan]} {
                set kickmsg "Private Spamming detected - Banned 10mins."
                putquick "KICK $kickchan $nick :$kickmsg"
                putquick "mode $kickchan +b $bmask $spambantime"

              }
        }
     }
}
}
}
but the bot doesn't kickban spammer when they use codes such as color...
so how can I strip the strings ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Use this code made by ppslim for his No!Spam script:

Code: Select all

proc ctrl:filter {str} {
  regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
  return $str
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well how do i do it ?
I make another bind msgm using this proc ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set text [ctrl:filter $text]
and the result will be the text without colors, bold, underline, reverse.. etc.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok i added the set text and the proc :)
thanx.
Locked