Skip to content
lsl.devlsl.devLSL Dev

llRequestSimulatorData

function
Function syntax
key llRequestSimulatorData(
  1. string region,// Case-sensitive region name.
  2. integer data// DATA_SIM_* flag of the requested simulator data. Values: SimulatorData
);
Returns
key
Delay
1 s
Energy
10

Asynchronously requests data (using a DATA_SIM_* constant) about the region. Triggers a dataserver event and returns a key query handle.

Requests data about region. When data is available the dataserver event will be raised.

Returns a key for a dataserver event response.

How to use
key result = llRequestSimulatorData("", 0);
data ConstantTypeDescription
DATA_SIM_POS5(vector)The regions global position.
DATA_SIM_STATUS6stringValueDescription
”up”region currently up and running
”down”region currently down
”starting”region currently starting
”stopping”region currently stopping
”crashed”region has crashed
”unknown”region status unknown or unknown region
DATA_SIM_RATING7stringValueMaturity rating
”PG"
"MATURE"
"ADULT"
"UNKNOWN”rating or region unknown
  • There is no DATA_SIM_MAXPRIMS flag (but llGetEnv("region_product_name") returns the region type). SVC-4921
Hide objects in PG or unknown regions
19 collapsed lines
key gRateingQuery = NULL_KEY ;
show()
{
llSetLinkAlpha( LINK_SET, 1.0, ALL_SIDES );
}//show
hide()
{
llSetLinkAlpha( LINK_SET, 0.0, ALL_SIDES );
}//hide
default
{
on_rez(integer Setting)
{
llResetScript();
}//on_rez
state_entry()
{
gRateingQuery = llRequestSimulatorData( llGetRegionName(), DATA_SIM_RATING );
}//state_entry
16 collapsed lines
changed(integer ItChanged)
{
if (ItChanged & CHANGED_OWNER) llResetScript();
if (ItChanged & CHANGED_REGION) llResetScript();
}//changed
dataserver(key query_id, string data)
{
if (query_id == gRateingQuery)
{
if (data == "MATURE" || data == "ADULT") show();
else if (data == "UNKNOWN" || data == "PG") hide();
}//gRateingQuery
}//dataserver
}//default

Global Position in meters

From the issue templates included by the wiki article:

  • SVC-2596 (bug): Script dataserver events become permanently blocked until sim restart
  • SVC-4921 (nf): Please add a way to get the region type (“full”, “homestead”, “openspace”) to llRequestSimulatorData
  • BUG-5031 (bug): llRequestSimulatorData for DATA_SIM_POS returns same position for multiple regions
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.