Yielding Methods
These allow your script to "wait" for a certain amount of time, allowing you to delay certain actions, instead of running everything at once.
How to find them?
Very simple! The serhelp methods command has a category called Yielding, where you can find yielding methods.
How to use them?
The Wait method
Wait methodThe simplest there is, its only argument is duration, meaning for how long should the script wait.
# Waits for 5 seconds
Wait 5s
# Waits for half a second
Wait 0.5s
# Waits for 15 milliseconds
Wait 15ms
# Waits for 5 minutes
Wait 5m
# Waits for half an hour
Wait .5hComments
Have you noticed lines like this? What are they?
These are comments! If the first character in the line is a pound sign, the entire line will be ignored! This allows us to document what a given script does.
The WaitUntil method
WaitUntil methodThis is a much more advanced method, which will wait until a certain condition evaluates to true.
Last updated