Skip to content

Server Script Events

ArchZombie edited this page Jun 16, 2013 · 14 revisions

Server Script Events[WIP]

Basic

  • loadScript: function () When the script is loaded, can be stopped with sys.stopEvent();
  • unloadScript: function() When the script is unloaded.
  • switchError: function(scr) When the script is unloaded, but the new script didn't load, and the old script is put back. Should bring the script back into a usable state.
  • warning: function(wrn) When a script function emits a warning control is transfered to the warning function which acts similarly to a signal handler. Beware that the script may be in an arbitrary state. If you throw the warning as an error this will be sent to the function that caused the error.

Server

  • serverStartUp: function() When the server starts up. For most things, loadScript is better.
  • serverShutDown: function() When the server shuts off. For most tings, unloadScript is better.
  • [before/after]NewMessage: function(msg) When a message is printed to the console. WARNING: Don't print messages carelessly in this event, otherwise it can cause an infinite loop.