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.

script - help plz

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

script - help plz

Post by EEggy »

hi, i tried my best, read tcl documentation but couldn't figure out, i'll appreciate if someone can help me
everytime when i type in partyline .rehash, i get this

<egg_> [05:11] Tcl error in file 'egg.conf':
<egg_> [05:11] no such binding
<egg_> while executing
<egg_> "unbind pubm [lindex $temp(bind) 1] [lindex $temp(bind) 2] wordkick:ctcp:badword"
<egg_> ("foreach" body line 3)
<egg_> invoked from within
<egg_> "foreach temp(bind) [binds ctcp] {
<egg_> if {[lindex $temp(bind) 4] == "wordkick:ctcp:badword"} {
<egg_> unbind pubm [lindex $temp(bind) 1] [lindex $temp(bind) 2..."
<egg_> (file "scripts/wordkick.tcl" line 45)
<egg_> invoked from within
<egg_> "source scripts/wordkick.tcl"
<egg_> (file "egg.conf" line 1319)
<egg_> [05:11] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)

codes:
wordkick(badwords) {
*badword1*
*badword2*
badword3
....
}

foreach temp(bind) [binds pubm] {
if {[lindex $temp(bind) 4] == "wordkick:pubm:badword"} {
unbind pubm [lindex $temp(bind) 1] [lindex $temp(bind) 2] wordkick:pubm:badword
}
}

foreach temp(bind) [binds ctcp] {
if {[lindex $temp(bind) 4] == "wordkick:ctcp:badword"} {
unbind pubm [lindex $temp(bind) 1] [lindex $temp(bind) 2] wordkick:ctcp:badword
}
}

foreach temp(word) [split $wordkick(badwords) \n] {
set temp(word) [string trim $temp(word) " \t"]
if {$temp(word) == ""} {continue}
bind pubm - "% $temp(word)" wordkick:pubm:badword
}

bind ctcp - ACTION wordkick:ctcp:badword

proc wordkick:ctcp:badword {nick uhost handle channel key text} {
global wordkick
foreach temp(word) [split $wordkick(badwords) \n] {
set temp(word) [string trim $temp(word) " \t"]
if {$temp(word) == ""} {continue}
if {[string match $temp(word) $text]} {
wordkick:badword $nick $uhost $handle $channel
return 0
}
}
}
proc wordkick:pubm:badword {nick uhost handle channel text} {
wordkick:badword $nick $uhost $handle $channel
return 0
}
proc wordkick:badword {nick uhost handle channel} {
.
.
.
.
}


i'll appreciate for your help
thanks
EEggy
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The most obvious part about it is this.

Code: Select all

foreach temp(bind) [binds ctcp] { 
if {[lindex $temp(bind) 4] == "wordkick:ctcp:badword"} { 
unbind pubm [lindex $temp(bind) 1] [lindex $temp(bind) 2] wordkick:ctcp:badword 
} 
} 
Read the first, then the third line. SOmthing doesn't match.
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

thanks ppslim, but i think i am still blind, i don't see anything is missing?

thanks
regards
EEggy
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

Thanks ppslim, i got it
EEggy
Locked