Difference between revisions of "DATA SIM STATUS"
Jump to navigation
Jump to search
(New page: {{LSL Constant |name=DATA_SIM_STATUS |type=integer |value=6 |desc=returns string. One of "up" simulator currently up and running "down" simulator currently down "starting" simulator...) |
m (<lsl> tag to <source>) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
|type=integer | |type=integer | ||
|value=6 | |value=6 | ||
|desc= | |desc=Returns one of these strings. | ||
"up" | * "up": simulator currently up and running | ||
"down" | * "down": simulator currently down | ||
"starting" | * "starting": simulator currently starting | ||
"stopping" | * "stopping": simulator currently stopping | ||
"crashed" | * "crashed": simulator has crashed | ||
"unknown" | * "unknown": simulator status unknown or unknown simulator | ||
|pa= | |pa= | ||
|text= | |text= | ||
|pb= | |pb= | ||
|examples | |examples=<source lang="lsl2">key queryData; | ||
default | |||
{ | |||
// querry immediately for simulator data on current status of sim. | |||
state_entry() | |||
{ | |||
queryData = llRequestSimulatorData( llGetRegionName(), DATA_SIM_STATUS ); | |||
} | |||
// if another owner or the region changes where the script operates in reset script | |||
changed( integer isChanged ) | |||
{ | |||
if( isChanged & CHANGED_REGION ) | |||
{ | |||
llResetScript(); | |||
} | |||
if( isChanged & CHANGED_OWNER ) | |||
{ | |||
llResetScript(); | |||
} | |||
} | |||
// how to handle the query information. | |||
dataserver( key queryID, string info ) | |||
{ | |||
if( queryID == queryData ) | |||
{ | |||
// output to upper case characters the current state of the sim. | |||
llOwnerSay( "This region is currently: " + llToUpper(info) ); | |||
} | |||
} | |||
}</source> | |||
|constants= | |constants= | ||
<!--{{LSL ConstRow|PAYMENT_INFO_ON_FILE}}--> | <!--{{LSL ConstRow|PAYMENT_INFO_ON_FILE}}--> |
Latest revision as of 14:33, 23 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer DATA_SIM_STATUS = 6;The integer constant DATA_SIM_STATUS has the value 6
Returns one of these strings.
- "up": simulator currently up and running
- "down": simulator currently down
- "starting": simulator currently starting
- "stopping": simulator currently stopping
- "crashed": simulator has crashed
- "unknown": simulator status unknown or unknown simulator
Caveats
Related Articles
Functions
• | llRequestSimulatorData |
Examples
key queryData;
default
{
// querry immediately for simulator data on current status of sim.
state_entry()
{
queryData = llRequestSimulatorData( llGetRegionName(), DATA_SIM_STATUS );
}
// if another owner or the region changes where the script operates in reset script
changed( integer isChanged )
{
if( isChanged & CHANGED_REGION )
{
llResetScript();
}
if( isChanged & CHANGED_OWNER )
{
llResetScript();
}
}
// how to handle the query information.
dataserver( key queryID, string info )
{
if( queryID == queryData )
{
// output to upper case characters the current state of the sim.
llOwnerSay( "This region is currently: " + llToUpper(info) );
}
}
}