The following is the usage information for the RedstoneTorch engine.

:: A few technical doohickies.
RedstoneTorch is run asynchronously as soon as the server loads plugins. It runs on it's own
thread in order to help minimize the impact on the server program. RT also only runs once -
upon start up, it will load all javascript files from the scripts/ directory, compile and then
execute them. 

If you are a plugin developer yourself, you are able to retrieve or set fields in
the engine through the use of RedstoneTorchEngine.set/getField(), but only after the plugin
has been loaded. In addition to this, as soon as the plugin is loaded, the asynchronous
task is scheduled. As such, scripts will be run likely before you can set fields.
That functionality is only there so you can program callbacks and set fields that way.
It may be possible in the future that I prevent scripts from being executed until the user
specifies, for example, RedstoneTorchEngine.execute(scriptName)/executeAll(), but until then,
you may find the usage of get/setField relatively.. limited.

:: How to use the engine.
Just install the engine like any other plugin - drop the .jar file inside your /plugins folder.
You'll need to create a /scripts folder in the base craftbukkit directory, in which you may
place any scripts that you want to be executed. Scripts in this directory are loaded in your
default system OS order (ie, for windows, we would load files in the order: 'special' characters,
numbers and finally alphabetical characters).

Files must be saved with the JS extension - they ARE javascript files. Currently no other
language is supported although I am tempted to extend RT to use Lua and/or Python (set via
configuration file).

Also note that RT's default environment has no java classes. You will need to import them -
personally I use the following methodology:
	var System = java.lang.System;
	
You can access any Java class inside Bukkit by using it's fully qualified name.
	var Server = org.bukkit.Server;

And so on. For more info, please read http://www.mozilla.org/rhino/doc.html.

There is one default JS object, and that is the EventManager for RedstoneTorch. Using this
object you can register events to be invoked by the engine in the future when said event is
triggered. You do this by accessing the global variable EventMgr, invoking the method register()
and giving it the parameters of the eventId (listed below) and function that you want to
register as an event. For example, if I wanted to create a callback for when a player joins
the server, I could use the following:
	var System = java.lang.System;
	// We use default Bukkit events.
	// You may need to cast these arguments due to the way Rhino works.
	function OnPlayerJoined(pPlayer, pLoginMessage) {
		System.out.println(pPlayer.getName()+" logged in.");
	}
	EventMgr.register(PLAYER_JOIN, OnPlayerJoined);

Note that we used PLAYER_JOIN as the event Id. This is because the engine contains global variables
for the identifiers of all supported events. The actual integer IDs may change as the engine
starts to accept more events, so I encourage you to use the globals, though you are entitled
to use integers should you wish.

:: Global Objects
EventMgr (class: RedstoneTorchEventManager)

:: Class: RedstoneTorchEventManager
:: Description: Allows for the registering of callbacks.
:: Methods:
	register(eventId, function) - Registers the function to be executed each time the event
		with the given id is called.

		
:: Event IDs
:: Note that these are also global variables in the environment.
PLAYER_JOINED	= 1;
PLAYER_CHAT		= 2;
