Skip to content
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.

Setup

  1. Add a timer event to any state you want to use it in:
    timer(){multiTimer([]);}
  2. 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.

Usage

  • 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"]);

Clone this wiki locally