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

Help for those learning Tcl or writing their own scripts.
Post Reply
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

script help

Post by Ace-T »

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..."
}

}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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..."
 }
}
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

Post by Ace-T »

tried your way and no luck, but it works on one bot my way but not on another
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

Post by Ace-T »

just seems to be the bind pub, ill take a better look when i get home ;p
x
xU
Voice
Posts: 7
Joined: Thu May 24, 2007 4:04 pm

Post by xU »

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..." 
} 
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@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
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

Post by Ace-T »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

And once you changed the binding, does the script work?
NML_375
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

Post by Ace-T »

all sorted, thx a million guys ;)
Post Reply