Someone was recently asking about waits, so I wrote out a really quick tutorial on timers:
Here is a basic timer routine that sits in a series of quarter second wait for ten seconds:
Code: Select All | Copy To Clipboard
Set %Timer #SCNT + 10
While %Timer > #SCNT
{
Wait 5
}
Halt
This timer is limited because the script won't do anything while it is waiting for the timer to expire.
This is a routine that lets you do other stuff until a timer expires every ten seconds, does whatever the timer is controlling, resets the timer, and keeps rolling on the "other stuff"
Code: Select All | Copy To Clipboard
Set %Timer #SCNT + 10
Repeat
{
; Do other stuff
If %Timer < #SCNT
GoSub Timed_Activity
Wait 1 ; if you don't have a wait in a loop it eats a lot of processor power.
}
Until #Charghost = Yes
Halt
Sub Timed_Activity
; Do whatever it is you are timing
Set %Timer #SCNT + 10
Return