I have just started using eggdrop and TCL. I have written two scripts, but only one of them works - the one that is put lower in config. But both scripts work just fine on it's own (without the second one).
They both have the same proc names, so the last one to load clobbers the 1st one's procs... Rename them to unique names, or use the namespace command (which is slightly more complicated.) Global vars should also use unique names.
so... the effect in eggdrop is the same, as if I would put all my scripts in one file? This is normal or is it a bug? So... I can use procnames from other script without including?
Last edited by Kobra on Sat Mar 17, 2007 5:24 pm, edited 1 time in total.
Yes, eggdrop will load any and all scripts into the same namespace and interpreter as it uses tcl's native "source" command. This behaviour is intended, as using namespaces requires special considderations when scripting, and creating multiple interpreter environments would require quite some work and use more resources, while really not providing any major advantages.
Of course, as rosc suggested, you can setup and use namespaces freely on your own, just as you would in any other tcl-enabled application.