Documentation

#ALARM

ALARM

Syntax: #ALA id {timepattern} {commands} class
Related: #TRIGGER #SUSPEND #RESUME

Allows you to set up a trigger based upon the time, rather than what is received from the server. The timepattern can contain a specific time, or can include wildcards as shown below. If preceded with a minus (-), the connection time is used rather than the current time.

Typically, the timepattern has the format hours:minutes:seconds, although the hours and minutes are optional. If missing, the hours or minute parameter is assumed to be an asterisk * wildcard. In place of a specific numeric value, you can use an asterisk to match any value. You can also use the special wildcard *value which will match when the time MOD the value is zero. E.g. *10 matches 10, 20, 30, etc.

You can also define a temporary, one-time alarm by specifying a plus (+) in front of the time. The command is executed when the alarm goes off and the alarm is then deleted.

A normal alarm cannot match a time smaller than or equal to half a second, so the fastest-repeating alarm you could have would be #alarm 0.501 {commands}. These restrictions don't apply to one-time alarms. The smallest unit of time you can use is a millisecond.

When used with only id and timepattern parameters it changes the pattern of the specified alarm.

ALARM Examples
#ALARM {-30:00} {sh ip dhcp bindings}
The hour isn't specified, so it defaults to *. Thus, this trigger shows your dhcp leases every 30 minutes of connect time.
#ALARM {3:00:00} {#ECHO "Time to go to bed!!"}
This alarm fires at 3am local time and displays a message to the currently focused window in TeSSH.
#ALARM {+5} {command}
Five seconds after creation sends the command to the server if command is an alias then it executes that script. This is a one-time alarm that deletes itself once it has executed.
#ALARM example {*5} {#SHOW example}
#ALARM example {*3}
Creates an alarm that will fire every 5 seconds then changes the time pattern to fire that alarm every 3 seconds.
#VAR time 5
#ALARM {+@time} {#EXEC @queue}
Executes the command stored in @queue in @time seconds. This is a one-time alarm that deletes itself once it has executed.
#EXEC {%concat(":Comms:#ALARM +",@time," {#CLR}")}
A contrived example. This demonstrates how to create an alarm in another window, with a variable from this window.

Add comment

Login or register to post comments