-
Notifications
You must be signed in to change notification settings - Fork 8
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: 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. Parameter = Script Name.
SCRIPT STOPPED : Activates when a script is terminated. Parameter = Script Name.
CONNECTION ACCEPTED : Server connection accepted. (no parameters).
CONNECTION LOST : Server connection lost. (no parameters).
CLIENT CONNECTED : Telnet client connected. (no parameters).
CLIENT DISCONNECTED : Telnet client disconnected. (no parameters).
TIME HIT : Activates when specified time is hit. Parameter = specified time.
Note that no triggers will activate unless the script has been paused with a "pause", "sleep", "waitFor" or "waitOn" command.
Example:
:Disc
connect
killAllTriggers
setDelayTrigger T1 :Timeout wait 60000
setEventTrigger T2 :tick "TIME HIT" "10:30:00 PM"
setEventTrigger T3 :Disc "CONNECTION LOST"
setTextTrigger T4 :Done "Command [TL="
pause
.