I saw an error checking routine one time that really impressed me but I didn't write it down and now I can't remember what it was for the life of me. Anyway, what it did was catch errors in a tcl script, output them to the party line and then just not load that script, it wouldn't crash the bot.
I know that it was done using catch but can anyone help me with some code for this? I've been pulling my hair out for days trying to figure it out.
It's probably a replacement "source" command. I wrote one once, it's pretty simple. Rename the old source command to "old_source" or something, then make a new source command that does catch {old_source $scriptname} and reports errors.
yeah, it did sort of replace the source command but it was really just a catch for the source. I've got it catching the error so that it doesn't crash the bot, I am just not sure how to show the error in the party line.
<font size=-1>[ This Message was edited by: PeTrArChY on 2002-01-09 08:17 ]</font>
I have a script that does what I was talking about earlier. That way you can use 'source' just like always and it still does the error catching and logging.
It would be nice if this was included with eggdrop by default, either via an option in the config to turn on, or the TCL included. I can't count the times I crashed my bot while trying to get a tcl working properly.