This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

unload

Help for those learning Tcl or writing their own scripts.
Post Reply
x
x-treem
Voice
Posts: 9
Joined: Mon Jul 21, 2008 11:13 am

unload

Post by x-treem »

is there a way to link to an event that pops when bot is forced to shutdown? for instance if i'm connected to somewhere to let a script clean up things and disconnect prior to close.
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

The answer depends entirely on how/why the bot is forced to shutdown. For example, a kill -9 <pid> from the bot's shell is immediate and would not allow time to execute code.

Generally, the EVNT bind is used to trigger Tcl code with a number of available types associated with shutdown (see tcl-commands.html in your bot installation).

sighup = kill -HUP <pid> OR kill -1 <pid> (hangup process)
sigill = kill -ILL <pid> OR kill -4 <pid> (illegal instruction)
sigquit = kill -QUIT <pid> OR kill -3 <pid> (quit process)
sigterm = kill -TERM <pid> OR kill -15 <pid> (terminate nicely)

I think I have the correct numeric kill signals. It is not clear in tcl-commands.html

I have never used these EVNT bind types, so I am not aware to what extent they would allow execution of Tcl before shutdown, neither am I aware of the shutdown type resulting from say the command .die in the partyline. Terminate nicely I would hope.

I can only suggest you experiment with them. Sorry I can't be of any further assistance.
Post Reply