-
Notifications
You must be signed in to change notification settings - Fork 4
MultiTimer
Tonaie edited this page Jan 24, 2017
·
1 revision
multiTimer is a function set in libjas which allows you to run multiple timers from a single script.
- Add a timer event to any state you want to use it in:
timer(){multiTimer([]);} - Create a new function:
timerEvent(string id, string data){ llSay(0, "Timer "+id+" timed out. Data was: "+data); }If you are an advanced user, timerEvent can be implemented as a preprocessor macro, and will save you 512 bytes if you do so compared to using LSL functions.
- Set a timer to go off after 2 seconds and then stop:
multiTimer(["testTimer", "This is test timer data", 2, FALSE]);
- Set a timer to go off EVERY 2 seconds until manually turned off:
multiTimer(["testTimer", "This is test timer data", 2, TRUE]);
- Remove a timer:
multiTimer(["testTimer"]);