event
Event syntax
timer() { … }Repeats the code in the timer(). Result of the llSetTimerEvent library function call.
timer(){
}Caveats
Section titled “Caveats”- The time between timer events can be longer than that specified with
llSetTimerEvent, this is caused by: - Time dilation - See
llGetRegionTimeDilationfor more information; - Default event delay - Only so many events can be triggered per second;
- Event Execution - If the execution of an event takes too long;
llSleep().- Only one timer can be active at one time.
- The timer survives state changes, but does not survive resets.
Examples
Section titled “Examples”Example 1
5 collapsed lines
float gap = 2.0;float counter = 0.0;
default{ state_entry() { // Activate the timer listener every 2 seconds llSetTimerEvent(gap); }
timer() { counter = counter + gap; llSay(0, (string)counter+" seconds have passed"); }}See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.