| View previous topic :: View next topic |
| Author |
Message |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Sun Jun 01, 2008 3:06 pm Post subject: Invalid Command Name |
|
|
I wrote a little script, which forwards all msgs to the bot to me, and lets me talk to the last talker through the bot.
if I write something now, I get this error in Partyline:
| Quote: | | Tcl Error [forward]: Invalid Command name "(the nick I have)" |
whats wrong with my script?
and is there a better way to check if someone is online than "onchan" ?
| Code: |
bind msgm - * forward
set owner "Nimos"
set ownerchan "#nimos"
proc forward {nick host hand text} {
global lastnick owner ownerchan
if {![$nick == $owner]} {
if {[onchan $owner $ownerchan]} {
puthelp "PRIVMSG $owner :$nick $text"
set lastnick "$nick"
}
} else {
puthelp "PRIVMSG $lastnick :$text"
}
}
|
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jun 01, 2008 4:41 pm Post subject: |
|
|
The flaw is this:
| Code: | | if {![$nick == $owner]} { |
Basically, you tell tcl to execute $nick as a command with first argument being == and second argument being $owner. Most likely not what you intended...
I'd suggest you use the string equal command to compare the strings, although you could do a simple comparison somewhat like the code suggests you thought of doing. With the second option however, don't treat it as a command. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Tue Jun 03, 2008 8:32 am Post subject: |
|
|
yea, I see...
I already fixed it myself yesterday |
|
| Back to top |
|
 |
|