Go to documentation repository
The Sleep method pauses the execution of the script for a specified period of time.
Syntax for method invocation:
function Sleep(milliseconds : int)
Method arguments:
Example 1. On macro 1, playback the following audio files one by one with audio player 1: cam_alarm_1.wav, cam_alarm_2.wav, cam_alarm_3.wav from the …\Axxon PSIM\Wav\ folder. The delay between the playback of each audio file must be five seconds (5000 milliseconds).
if (Event.SourceType == "MACRO" && Event.SourceId == "1" && Event.Action == "RUN") { var i; for(i=1; i<=3; i=i+1) { DoReactStr("PLAYER", "1", "PLAY_WAV", " file<\cam_alarm_" + i + ".wav>"); Sleep(5000); } }
Example 2. On macro 2, start the timer 1 that triggers every 10 seconds for a minute from the start of macro 2.
Note
To start this script, you must create the Timer object with ID 1 beforehand. Leave the default object parameters (Any). The Timer 1 object can be disabled.
if (Event.SourceType == "MACRO" && Event.SourceId == "2" && Event.Action == "RUN") { for(i=0; i<=5; i=i+1) { DoReactStr("TIMER","1", "DISABLE", ""); Sleep(10000); DoReactStr("TIMER","1", "ENABLE", ""); NotifyEventStr("TIMER","1", "TRIGGER", ""); } DoReactStr("TIMER","1", "DISABLE", ""); }