In the current TWX Proxy script API documentation. It
states the following:
setEventTrigger
Purpose: Creates a trigger that will activate on a certain
program event.
Syntax: setEventTrigger {name} {label} {event}
[{parameter}]
{name}: The name of the trigger to create. This name is
used for later references to the trigger.
{label}: A label within the script to jump to when the
trigger is activated.
{event}: The name of the program event to attach the
trigger to (see below).
[{parameter}]: Some (but not all) program events require
parameters. These are specified here.
Notes: Triggers mark the way in which TWX Scripts
interact with their environment (Trade Wars).
The event trigger will automatically jump to a label within
the script and start executing as soon as a program
event occurs matching its specification.
Currently, TWX Proxy supports the following program
events and their parameters:
SCRIPT LOADED : Activates when a script is loaded.
Its parameter is the name of the script loaded.
SCRIPT STOPPED : Activates when a script is
terminated. Its parameter is the name of the script
terminated.
CONNECTION ACCEPTED : Activates when TWX Proxy
connects to the remote server (no parameters).
CONNECTION LOST : Activates when TWX Proxy
disconnects from the remote server (no parameters).
CLIENT CONNECTED : Activates when a telnet client
connects to TWX Proxy (no parameters).
CLIENT DISCONNECTED : Activates when a telnet
client disconnects from TWX Proxy (no parameters).
TIME HIT : Activates when the click hits a certain time.
Its parameter is the specified time in system format.
Note that no triggers will activate unless the script has
been paused with a "pause", "waitFor" or "waitOn"
command.
After working on a script that requires the use of the
SCRIPT LOADED and SCRIPT STOPPED events. I
have found that the setEvenTrigger does not work as it
should. At least not the way it should for the SCRIPT
LOADED and SCRIPT STOPPED events.
If you include the script name as the parameter for either
of the two events. To show that you are looking for that
specific script to be loaded, or stopped. TWX Proxy
does not recognize that the script was loaded, or even
stopped. It just continues to set there waiting for the
event to transpire.
Using the above two events without the script name.
Produces the desired results, but has the draw back
that any script that is loaded, or stopped, to activate the
event. Which could have disastorous results with the
script.
NOTE: This bug is present in v2.00, v2.02 and v2.03
official releases, including the v2.03 build 13.
We can easily change the documentation to reflect the
current behavior, and proper use, of the events
mentioned above. Or we can fix the events, so that they
reflect what the docs state.
I have no idea if the TIME HIT event is also effected by
this bug. Will have to do some testing to find out.
Logged In: YES
user_id=125788
Okay, after some more testing. I have found that the SCRIPT
LOADED and SCRIPT STOPPED events do work. But, they
require that the script name to include the path and the file
extension.
Since the Stop command to not require the path and file
extension. I am believe that the SCRIPT LOADED and
SCRIPT STOPPED events should follow the same naming
convention.