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.

Ctcp scan tcl error

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Ctcp scan tcl error

Post by Gothic-Angel »

Code: Select all

bind join - * send:finger
bind ctcr - FINGER check:finger
set spamkickmsg "Infected spam drone. Visit 
\002http://kline.dal.net/exploits/akills.htm#ma\002 for more information."

proc send:finger {nick uh hand chan} {
if {[matchattr $hand f|f] || [isop $nick $chan]} { return 0 }
putquick "PRIVMSG $nick :\001FINGER\001"
}

proc check:finger {nick uh hand dest key arg} {
    global spamkickmsg botnick
    if {![isbotnick $dest]} { retrun }
    set arg1 [string tolower $arg]
    if {([regexp -nocase "%email" $arg1]) || ([regexp -nocase "%iloveuayas" 
$arg1]) || ([regexp -nocase "ybxoevq@@" $arg1]) || ([regexp -nocase "%nama" 
$arg1]) || ([regexp -nocase "asdgfsdg" $arg1]) || ([regexp -nocase "Q8HaCk" 
$arg1])} {
        foreach chan [channels] {
            set bmask "*!*[string range $uh [string first "@" $uh] end]"
            if {[onchan $nick $chan]} {
                putquick "MODE $chan +b $bmask"
                putserv "KICK $chan $nick :$spamkickmsg"
                newchanban $chan $bmask $botnick $spamkickmsg 240
            }
        }
    }
}

I get this error [00:34] Tcl error [check:finger]: wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"

Is there something wrong with the code? Anyway I can fix it?
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

erm I've checked it and it worked! Restart your bot
-
[11:33] *** Joins: bot (bot@unc.tk)
[11:33] *** Mode (Tweety:# +b *!*@unc.tk)
*** [Banned]: bot
[11:33] *** bot was kicked by Tweety (Infected spam drone. Visit http://kline.dal.net/exploits/akills.htm#ma for more information.)
-
bmask could be done simplier
set bmask "*!*@[lindex [split $uh @] 1]"
check this, it's easier to manage in case if you wanted to add new forbidden ctcp finger replies
bind join - * send:finger
set fingers {
"*%email*"
"example1"
"examplx"
"asdgfsdg"
"q8hack"
}
bind ctcr - FINGER check:finger
set spamkickmsg "Infected spam drone. Visit \002http://kline.dal.net/exploits/akills.htm#ma\002 for more information."

proc send:finger {nick uh hand chan} {
if {[matchattr $hand f|f] || [isop $nick $chan]} { return 0 }
putquick "PRIVMSG $nick :\001FINGER\001"
}

proc check:finger {nick uh hand dest key arg} {
global spamkickmsg botnick fingers
if {![isbotnick $dest]} { retrun }
foreach finger $fingers {
set arg1 [string tolower $arg]
if {[string match $finger $arg1]} {
foreach chan [channels] {
set bmask "*!*@[lindex [split $uh @] 1]"
if {[onchan $nick $chan]} {
putquick "MODE $chan +b $bmask"
putserv "KICK $chan $nick :$spamkickmsg"
newchanban $chan $bmask $botnick $spamkickmsg 240
}
}
}
}
}
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

Its working now, however how would I add it only do a few channels out of all the ones its opped in?

Say Its in #blah #heh #teehe #hmm #argh

and I only want it to finger users in #blah and #argh?
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

# Chans where the script is supposed to work. "" means all chans.
set chanz "#blah #arg"

change procs a bit

proc send:finger {nick uh hand chan} {
if {[matchattr $hand f|f] || [isop $nick $chan]} { return 0 }
if {($chanz != "") && ([lsearch -exact [split [string tolower $chanz]] [string tolower $dest]] == -1)} {return 0}
putquick "PRIVMSG $nick :\001FINGER\001"
}
# end

add chanz to global and enjoy :)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

In the above script, it states "work in listed channels, or all if blank".

The code, check to see if the channel is in the list, and that the list isn't empty.

As such, only working if a channel is listed.

To fix this, simply changing the && in the if, doing the check, to || will fix this.
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

Gothic leave "&&"

cheers :)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yup, leave the &&, honest.

I apparently need to read the posts properly before replying to them, well, make that read them at least a little bit!! :P
Locked