Difference between revisions of "LlMinEventDelay"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
m (Whoops! Wrong template lol — I wanted to press Show Preview and not Save Changes! Fixed now.)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
|return_text
|return_text
|spec
|spec
|caveats= minimum delay is maintained between state changes.   
|caveats=Minimum delay is maintained between state changes.   
|constants
|constants
|examples=
|examples=
<source lang="lsl2">default
<syntaxhighlight lang="lsl2">default
{
{
     state_entry()
     state_entry()
Line 24: Line 24:
                             //with the word "Touched" in a split second if you held the mouse button down.
                             //with the word "Touched" in a split second if you held the mouse button down.
     }
     }
}</source>
}</syntaxhighlight>


Where as, if in one object you place this script (for the sake of fun call the object "Sandy Powell"). -
Where as, if in one object you place this script (for the sake of fun call the object "Sandy Powell"). -


<source lang="lsl2">default
<syntaxhighlight lang="lsl2">default
{
{
     touch(integer detected)
     touch(integer detected)
     {
     {
         llSay(0, "Can you hear me mother?");//Northern English accent. Catch phase of Sandy Powell (comedian).
         llSay(0, "Can you hear me mother?"); //Northern English accent. Catch phase of Sandy Powell (comedian).
     }
     }
}</source>
}</syntaxhighlight>


and this in another object called "Mother" -
and this in another object called "Mother" -


<source lang="lsl2">default
<syntaxhighlight lang="lsl2">default
{
{
     state_entry()
     state_entry()
Line 49: Line 49:
         llSay(0, "Eh?");
         llSay(0, "Eh?");
     }
     }
}</source>
}</syntaxhighlight>


the result in chat is as follows -
the result in chat is as follows -


<pre>
{{Samp|1=
[12:51]  Sandy Powell: Can you hear me mother?
[12:51]  Sandy Powell: Can you hear me mother?
[12:51]  Mother: Eh?
[12:51]  Mother: Eh?
Line 98: Line 98:
[12:52]  Mother: Eh?
[12:52]  Mother: Eh?
[12:52]  Mother: Eh?
[12:52]  Mother: Eh?
</pre>
}}
and no more events are triggered. This is an example of lost transferred info because of [[llMinEventDelay]] so be careful with it.
and no more events are triggered. This is an example of lost transferred info because of [[llMinEventDelay]] so be careful with it.
|helpers
|helpers

Latest revision as of 10:43, 1 October 2022

Summary

Function: llMinEventDelay( float delay );

Set the minimum time between events being handled.

Defaults and minimums vary by the event type, see LSL Delay.

• float delay time in seconds

Caveats

Minimum delay is maintained between state changes.

All Issues ~ Search JIRA for related Bugs

Examples

default
{
    state_entry()
    {
        llMinEventDelay(5.0);
    }
    touch(integer detected)
    {
        llSay(0, "Touched.");//Without the event delay set touch would cause the screen to fill 
                             //with the word "Touched" in a split second if you held the mouse button down.
    }
}

Where as, if in one object you place this script (for the sake of fun call the object "Sandy Powell"). -

default
{
    touch(integer detected)
    {
        llSay(0, "Can you hear me mother?"); //Northern English accent. Catch phase of Sandy Powell (comedian).
    }
}

and this in another object called "Mother" -

default
{
    state_entry()
    {
        llMinEventDelay(5.0);
        llListen(0, "Sandy Powell", "", "");
    }
    listen(integer chan, string name, key id, string msg)
    {
        llSay(0, "Eh?");
    }
}

the result in chat is as follows -

[12:51] Sandy Powell: Can you hear me mother? [12:51] Mother: Eh? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Sandy Powell: Can you hear me mother? [12:51] Mother: Eh? [12:51] Mother: Eh? [12:51] Mother: Eh? [12:51] Mother: Eh? [12:51] Mother: Eh? [12:51] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh? [12:52] Mother: Eh?

and no more events are triggered. This is an example of lost transferred info because of llMinEventDelay so be careful with it.

See Also

Articles

•  LSL Delay for default values

Deep Notes

Search JIRA for related Issues

Signature

function void llMinEventDelay( float delay );