egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

script help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Fri May 25, 2007 8:03 am    Post subject: script help Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri May 25, 2007 8:22 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Fri May 25, 2007 8:34 am    Post subject: Reply with quote

tried your way and no luck, but it works on one bot my way but not on another
Back to top
View user's profile Send private message
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Fri May 25, 2007 8:38 am    Post subject: Reply with quote

just seems to be the bind pub, ill take a better look when i get home ;p
Back to top
View user's profile Send private message
xU
Voice


Joined: 24 May 2007
Posts: 7

PostPosted: Fri May 25, 2007 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri May 25, 2007 12:11 pm    Post subject: Reply with quote

@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
View user's profile Send private message
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Fri May 25, 2007 5:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri May 25, 2007 5:53 pm    Post subject: Reply with quote

And once you changed the binding, does the script work?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Fri May 25, 2007 5:54 pm    Post subject: Reply with quote

all sorted, thx a million guys Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber