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 for those learning Tcl or writing their own scripts.
Ace-T
Halfop
Posts: 82 Joined: Tue Aug 29, 2006 7:25 am
Post
by Ace-T » Fri May 25, 2007 8:03 am
im a little confused....
this script i have made is soooo simple and works fine with one of my bots, but one another it wont and dont have a clue why =/
here is the code but i cant see no problems =/
Code: Select all
bind pubm * sitetest_info
proc sitetest_info {nick host handle channel text} {
set test [lindex $text 1]
set test2 [lindex $text 3]
if { $test == "TEST" } {
putquick "PRIVMSG $channel :TEST..."
}
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri May 25, 2007 8:22 am
It won't work on any of your bots since the number of arguments passed to bind is incorrect. You also have problems in using [lindex] over strings.
Code: Select all
bind pubm - * sitetest_info
proc sitetest_info {nick host handle channel text} {
set test [lindex [split $text] 1]
set test2 [lindex [split $text] 3]
if {$test == "TEST"} {
putquick "PRIVMSG $channel :TEST..."
}
}
Ace-T
Halfop
Posts: 82 Joined: Tue Aug 29, 2006 7:25 am
Post
by Ace-T » Fri May 25, 2007 8:34 am
tried your way and no luck, but it works on one bot my way but not on another
Ace-T
Halfop
Posts: 82 Joined: Tue Aug 29, 2006 7:25 am
Post
by Ace-T » Fri May 25, 2007 8:38 am
just seems to be the bind pub, ill take a better look when i get home ;p
xU
Voice
Posts: 7 Joined: Thu May 24, 2007 4:04 pm
Post
by xU » Fri May 25, 2007 11:13 am
Code: Select all
bind pubm * sitetest_info
proc sitetest_info {nick host handle channel text} {
set test [string toupper [lindex $text 1]]
set test2 [string toupper [lindex $text 3]]
if { $test == "TEST" } {
putquick "PRIVMSG $channel :TEST..."
}
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Fri May 25, 2007 12:11 pm
@xU:
You're using a b0rken binding, see Sir_Fz's post on how to properly do it. You also, improperly, use lindex on strings..
Finally, if you considder making matching non-case sensitive, with recent versions of tcl you might just use "string equal -nocase <string1> <string2>".
@Ace-T:
I'd suspect you've got a working binding somewhere on that one bot, possibly from a previous version of the script?
Keep in mind that unless you completely restart your bot, old bindings, procs (that are'nt overwritten), etc will remain within the bot, even if you edit/remove the script from your config-file.
Try typing .binds from your dcc-console to see which bindings are currently registered on your bots.
NML_375
Ace-T
Halfop
Posts: 82 Joined: Tue Aug 29, 2006 7:25 am
Post
by Ace-T » Fri May 25, 2007 5:51 pm
i only have that script running and yes i have restarted it,
when i did .binds i checked and all seemd ok,
only prob was with the pubm * it wouldnt show but if i changed the pub to bind pub "-|-" !test sitetest_info it showed up in .binds
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Fri May 25, 2007 5:53 pm
And once you changed the binding, does the script work?
NML_375
Ace-T
Halfop
Posts: 82 Joined: Tue Aug 29, 2006 7:25 am
Post
by Ace-T » Fri May 25, 2007 5:54 pm
all sorted, thx a million guys