Difference between revisions of "LlSetScriptState"
Jump to navigation
Jump to search
Bazza Carter (talk | contribs) |
Lady Sumoku (talk | contribs) m (Replaced old <LSL> block with <source lang="lsl2">) |
||
(19 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LSL Function | ||
{{ | |inject-2={{Issues/SVC-1853}}{{LSL Function/inventory|name|uuid=false|type=script}}{{LSL Function/boolean|running|if=*|bool=*|non-zero=*|td=the script will be enabled|fd=the script will be disabled}} | ||
|func_id=148|func_sleep=0.0|func_energy=10.0 | |func_id=148|func_sleep=0.0|func_energy=10.0 | ||
|func=llSetScriptState | |func=llSetScriptState | ||
|p1_type=string|p1_name=name | |p1_type=string|p1_name=name | ||
|p2_type=integer| | |p2_type=integer|p2_subtype=boolean|p2_name=running | ||
|func_footnote | |func_footnote | ||
|func_desc=Set the running state of the script | |func_desc=Set the running state of the script {{LSLP|name}}. | ||
|return_text | |return_text | ||
|spec | |spec | ||
|caveats=*Cannot be used to restart a script that has | |caveats=*Cannot be used to restart a script that has encountered a {{LSLGC|Error|run-time error}}. | ||
*[ | *Cannot be used to start a script that has been added via [[llGiveInventory]]. Scripts sent via [[llRemoteLoadScriptPin]], and which have the running state set FALSE by that command, may be started. | ||
*The script appears to stop when its time slice ends, not sooner. If a script tries to stop itself then some LSL code following the llSetScriptState call may be executed before the script stops. | |||
*If a script is paused by llSetScriptState and is then either re-rezzed, in a region during a restart, or moved into a different region, the script's memory is reset. | |||
|constants | |constants | ||
|examples= | |examples= | ||
<source lang="lsl2">//Stops the Script, at some non-deterministic time later, until invoked with TRUE, in another script | |||
Stops the Script, | llSetScriptState(llGetScriptName(),FALSE); | ||
// Stall until end of time slice | |||
llSetScriptState("somescript",TRUE); | llSleep(0.1);</source> | ||
<source lang="lsl2">//Starts Another Script | |||
llSetScriptState("somescript",TRUE);</source> | |||
|helpers | |helpers | ||
|also_functions= | |also_functions= | ||
Line 27: | Line 29: | ||
|also_articles | |also_articles | ||
|notes | |notes | ||
| | |issues | ||
|cat1= | |cat1=Inventory | ||
|cat2 | |cat2=Script | ||
|cat3 | |cat3= | ||
|cat4 | |cat4= | ||
}} | }} |
Latest revision as of 14:07, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Caveats
- If name is missing from the prim's inventory or it is not a script then an error is shouted on DEBUG_CHANNEL.
- Cannot be used to restart a script that has encountered a run-time error.
- Cannot be used to start a script that has been added via llGiveInventory. Scripts sent via llRemoteLoadScriptPin, and which have the running state set FALSE by that command, may be started.
- The script appears to stop when its time slice ends, not sooner. If a script tries to stop itself then some LSL code following the llSetScriptState call may be executed before the script stops.
- If a script is paused by llSetScriptState and is then either re-rezzed, in a region during a restart, or moved into a different region, the script's memory is reset.
Examples
//Stops the Script, at some non-deterministic time later, until invoked with TRUE, in another script
llSetScriptState(llGetScriptName(),FALSE);
// Stall until end of time slice
llSleep(0.1);
//Starts Another Script
llSetScriptState("somescript",TRUE);
See Also
Functions
• | llGetScriptState | |||
• | llResetOtherScript |