Difference between revisions of "DATA SIM STATUS"

From Second Life Wiki
Jump to navigation Jump to search
m (Re-format)
(This is to provide an example of DATA_SIM_STATUS for people to see how to use it.)
Line 13: Line 13:
|text=
|text=
|pb=
|pb=
|examples
|examples=<lsl>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) );
        }
    }
}</lsl>
|constants=
|constants=
<!--{{LSL ConstRow|PAYMENT_INFO_ON_FILE}}-->
<!--{{LSL ConstRow|PAYMENT_INFO_ON_FILE}}-->

Revision as of 11:31, 30 October 2013

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

Related Articles

Functions

•  llRequestSimulatorData

Examples

<lsl>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) );
       }
   }

}</lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer DATA_SIM_STATUS = 6;