I have a script that I have been working on for a while now and I cannot get the script to process $nick in a "switch" command. The TCL script does not recognize $nick, which in my thoughts, doesn't seem right.
This script has worked before, I made a few changes to how the arguments were grouped and it still did not work. I have even tried setting the nick to [set nick "[lindex $nick 0]" ]. Would anybody have any suggestions?
I am using Windrop 1.6.17 with TCL library 8.4
What's the error message? Also, are you sure the error is happening in this proc and not one of the ones it calls? Try adding "putlog $nick" in a few places to see 1) how far it gets and 2) exactly when the variable "disappears"
I have found out that it stops right at the "switch" statement.
I'm sure that this is not running to the proc that it is calling, the proc that it is calling does not even exist, so I would expect an error message stating that there is no such procedure.
The $nick variable is gone outside, and past the switch command. The error message it returns is :
[19:56] Tcl error [proc_switch]: can't read "nick": no such variable
I copied your code into tclsh, and it works fine.. no error about nick.
Also... in case you didn't know, the proc that eggdrop reports the error happening in is not necessarily where the error happens, it is just the bind that triggered the error.
To find out a little bit more, make sure you have the .tcl command enabled, and immediately after the error occurs type
.tcl putlog $errorInfo
Note the capital I in Info, it won't work otherwise. It will hopefully tell you more precisely where the error happened. Paste the exact output here and it should help us find the problem.
ps I tried metroid's code too and it worked fine... no difference
I found out that whenever I kept rehashing my bot, the procs would not clear themselves out. Therefore, when I checked out .tcl $errorInfo, it kept calling a proc that was not even in pub, just as stdragon said. It came down to having the incorrect arguments in a proc I wrote with the wrong number or arguments, and I had recently had a userfile change, so that contributed to part of the problem.
Thanks again for your time. I appreciate it.