Difference between revisions of "LlResetScript"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced <source> with <syntaxhighlight>; added haiku, generated with the Poem Generator and tweaked by self)
(10 intermediate revisions by 7 users not shown)
Line 2: Line 2:
|func_id=163|func_sleep=0.0|func_energy=10.0
|func_id=163|func_sleep=0.0|func_energy=10.0
|func=llResetScript
|func=llResetScript
|func_footnote
|func_footnote=On script reset...
|func_desc=Resets the script
*The current event/function is exited without further execution or return.
*Any granted URLs are released.
*All global variables are set to their defaults.
*Timers (including repeating sensors) are cleared.
*Listeners are removed.
*The event queue is cleared.
*The [[default]] state is set as the active state.
**If it has a [[state_entry]] event, then it is queued.
|func_desc=Resets the script.
|return_text
|return_text
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples
|examples=
<syntaxhighlight lang="lsl2">
default
{
    // reset script when the object is rezzed
    on_rez(integer start_param)
    {
        llResetScript();
    }
 
    changed(integer change)
    {
        // reset script when the owner or the inventory changed
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
            llResetScript();
    }
 
    // script initialization here
    state_entry()
    {
        ;
    }
}
</syntaxhighlight>
|helpers
|helpers
|also_functions
|also_functions=*{{LSLG|llResetOtherScript}}
|also_events
|also_events
|also_tests
|also_tests
Line 18: Line 49:
|negative_index
|negative_index
|sort=ResetScript
|sort=ResetScript
|haiku={{Haiku|Precipitous cliff|A whole universe reset|by its old owner}}
|cat1=Script
|cat1=Script
|cat2
|cat2

Revision as of 05:49, 23 April 2022

Summary

Function: llResetScript( );

Resets the script.

On script reset...

  • The current event/function is exited without further execution or return.
  • Any granted URLs are released.
  • All global variables are set to their defaults.
  • Timers (including repeating sensors) are cleared.
  • Listeners are removed.
  • The event queue is cleared.
  • The default state is set as the active state.

Examples

default
{
    // reset script when the object is rezzed
    on_rez(integer start_param)
    {
        llResetScript();
    }

    changed(integer change)
    {
        // reset script when the owner or the inventory changed
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
            llResetScript();
    }

    // script initialization here
    state_entry()
    {
        ;
    }
}

See Also

Functions

Deep Notes

Search JIRA for related Issues

Signature

function void llResetScript();

Haiku

Precipitous cliff
A whole universe reset
by its old owner