Difference between revisions of "LlResetOtherScript"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 6: Line 6:
*The current event/function is exited without further execution or return.
*The current event/function is exited without further execution or return.
*All global variables are set to their defaults
*All global variables are set to their defaults
*The event queue is cleared.
*The event queue is cleared, and recurring events are stopped.
*The [[default]] state is set as the active state
*The [[default]] state is set as the active state
**If it has a [[state_entry]] event, then it is queued.
**If it has a [[state_entry]] event, then it is queued.
Line 20: Line 20:
{
{
state_entry(){
state_entry(){
llListen(menu_channel, "", NULL_KEY, "");
llListen(menu_channel, "", "", "");
}
}
Line 30: Line 30:
if (message == "Yes"){
if (message == "Yes"){
llSay(0, "Reseting script...");
llSay(0, "Reseting script...");
llResetOtherScript("Database_script");} // The script must be in the same prim and doesn`t have to be active
llResetOtherScript("Database_script"); // The script must be in the same prim and doesn`t have to be active
else
} else
llSay(0, "Operation cancelled");
llSay(0, "Operation canceled");
}
}
}
}
Line 44: Line 44:
|also_articles
|also_articles
|notes
|notes
|permission
|negative_index
|sort=ResetOtherScript
|sort=ResetOtherScript
|cat1=Script
|cat1=Script

Revision as of 14:51, 26 November 2007

Summary

Function: llResetOtherScript( string name );

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.
All Issues ~ Search JIRA for related Bugs

Examples

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 doesn`t have to be active
		} else
			llSay(0, "Operation canceled");
	}	
}

See Also

Functions

•  llResetScript
•  llGetScriptState
•  llSetScriptState

Deep Notes

Search JIRA for related Issues

Signature

function void llResetOtherScript( string name );