Difference between revisions of "LlResetOtherScript"

From Second Life Wiki
Jump to navigation Jump to search
m (maybe I'm confusing the used definition of "active"... using "running" instead)
(cat Inventory)
Line 1: Line 1:
{{LSL_Function/inventory|name|uuid=false|type=script}}
{{LSL Function/inventory|name|uuid=false|type=script}}
{{LSL_Function
{{LSL Function
|func_id=249|func_sleep=0.0|func_energy=10.0
|func_id=249|func_sleep=0.0|func_energy=10.0
|func=llResetOtherScript|p1_type=string|p1_name=name
|func=llResetOtherScript|p1_type=string|p1_name=name
Line 12: Line 12:
|return_text
|return_text
|spec
|spec
|caveats=*If the script is not running, this call has no effect, even after the script is set running again.
|caveats=
*If the script is not running, this call has no effect, even after the script is set running again.
|constants
|constants
|examples=
|examples=
Line 46: Line 47:
|notes
|notes
|sort=ResetOtherScript
|sort=ResetOtherScript
|cat1=Script
|cat1=Inventory
|cat2=Stop
|cat2=Script
|cat3
|cat3=Stop
|cat4
|cat4=
}}
}}

Revision as of 04:40, 25 February 2012

Summary

Function: llResetOtherScript( string name );
0.0 Forced Delay
10.0 Energy

Resets script name

• string name a script in the inventory of the prim this script is in

On script reset...

  • The current event/function is exited without further execution or return.
  • All global variables are set to their defaults
  • The event queue is cleared, and recurring events are stopped.
  • The default state is set as the active state

Caveats

  • If name is missing from the prim's inventory or it is not a script then an error is shouted on DEBUG_CHANNEL.
  • If the script is not running, this call has no effect, even after the script is set running again.

Examples

<lsl> integer menu_channel = -2345;

default { state_entry(){ llListen(menu_channel, "", "", ""); }

touch_start(integer total_number){ llDialog(llDetectedKey(0), "Reset database script?", ["Yes", "No"], menu_channel); }

listen(integer channel, string name, key id, string message){ if (message == "Yes"){ llSay(0, "Reseting script..."); llResetOtherScript("Database_script"); // The script must be in the same prim and does have to be running } else llSay(0, "Operation canceled"); } }

</lsl>

See Also

Functions

•  llResetScript
•  llGetScriptState
•  llSetScriptState

Deep Notes

Signature

function void llResetOtherScript( string name );