| View previous topic :: View next topic |
| Author |
Message |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Fri May 25, 2007 8:03 am Post subject: script help |
|
|
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: |
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..."
}
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri May 25, 2007 8:22 am Post subject: |
|
|
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: | 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..."
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Fri May 25, 2007 8:34 am Post subject: |
|
|
| tried your way and no luck, but it works on one bot my way but not on another |
|
| Back to top |
|
 |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Fri May 25, 2007 8:38 am Post subject: |
|
|
| just seems to be the bind pub, ill take a better look when i get home ;p |
|
| Back to top |
|
 |
xU Voice
Joined: 24 May 2007 Posts: 7
|
Posted: Fri May 25, 2007 11:13 am Post subject: |
|
|
| Code: |
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..."
} |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri May 25, 2007 12:11 pm Post subject: |
|
|
@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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Fri May 25, 2007 5:51 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri May 25, 2007 5:53 pm Post subject: |
|
|
And once you changed the binding, does the script work? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Fri May 25, 2007 5:54 pm Post subject: |
|
|
all sorted, thx a million guys  |
|
| Back to top |
|
 |
|