User:Opensource Obscure/LSL/Sim Hud Stat Open
Go back to Opensource Obscure's userpage
<lsl>
string language = "it"; float distance = 96.0; string message0 = ""; list landinforeqd = [PARCEL_DETAILS_NAME, PARCEL_DETAILS_OWNER, PARCEL_DETAILS_GROUP, PARCEL_DETAILS_ID]; vector regionbase; string message; string regione; integer lang_check; string nomeorig;
fai() {
llSetObjectName("");
llOwnerSay("-------------------------------------");
regionbase = llGetPos();
string version = llGetEnv("sim_channel") + " " + llGetEnv("sim_version");
message = "";
list details = llGetParcelDetails(regionbase,landinforeqd);
regione = llGetRegionName();
string chiave_agent = llList2String(details ,1);
llOwnerSay(
"Parcel: secondlife:///app/parcel/"
+ llList2String(details ,3)
+ "/about"
//
+ " - proprietà di "
+ "secondlife:///app/agent/"
+ chiave_agent
+ "/inspect"
);
// if( llGetRegionFlags() & REGION_FLAG_SANDBOX )
{
// message += regione + " is a sandbox region. ";
}
// else
{
// message += regione + " is not a sandbox region. ";
}
if( llGetRegionFlags() & REGION_FLAG_FIXED_SUN )
{
message += ("Sun is fixed. ");
}
else
{
// message += ("Sun isn't fixed. ");
}
if( llGetRegionFlags() & REGION_FLAG_ALLOW_DIRECT_TELEPORT )
{
// message += ("Direct teleports are allowed. ");
}
else
{
message += ("Direct teleports are not allowed. ");
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_TERRAFORM )
{
message += ("YOU CAN TERRAFORM HERE !! ");
}
else
{
// message += ("Terraforming is blocked. ");
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_FLY )
{
// message += "You can fly here. ";
}
else
{
message += "You cannot fly here. ";
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_OBJECTS )
{
message += "People can rez here. ";
}
else
{
// message += "You cannot rez here. ";
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY )
{
message += "Objects can enter this parcel. ";
}
else
{
// message += "Objects cannot enter this parcel. ";
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_SCRIPTS )
{
// message += "Scripts allowed. ";
}
else
{
message += "Scripts not allowed. ";
}
if( llGetParcelFlags(llGetPos()) & PARCEL_FLAG_RESTRICT_PUSHOBJECT )
{
message += "Parcel restricts llPushObject. ";
}
else
{
message += "Parcel doesn't restricts llPushObject. ";
}
if( llGetRegionFlags() & REGION_FLAG_DISABLE_COLLISIONS )
{
message += ("Collisions are disabled. ");
}
else
{
message += ("Collisions are enabled. ");
}
if( llGetRegionFlags() & REGION_FLAG_RESTRICT_PUSHOBJECT )
{
message += ("llPushObject calls are restricted. ");
}
else
{
message += ("llPushObject calls are not restricted. ");
}
llOwnerSay(message);
llOwnerSay(version );
llOwnerSay("Time Dilation: " + (string)llGetRegionTimeDilation());
lang_check = FALSE;
llSensor("", NULL_KEY, AGENT, distance, PI);
llSetObjectName(nomeorig);
}
default
{
state_entry()
{
nomeorig = llGetObjectName();
}
touch_start(integer total_number)
{
fai();
}
changed(integer change)
{
if (change & CHANGED_REGION) //note that it's & and not &&... it's bitwise!
{
fai();
}
}
sensor(integer total_number)
{
llSetObjectName("");
message0 =
"ci sono "
+ (string)llGetRegionAgentCount()
+ " persone in tutto nella sim. Italiani nei dintorni: ";
integer i;
for (i = 0; i < total_number; i++)
{
if(llGetAgentLanguage(llDetectedKey(i)) == language)
{
lang_check = TRUE;
message0 +=
" "
+ " secondlife:///app/agent/"
+ (string)llDetectedKey(i)
+ "/about";
}
}
llOwnerSay(message0);
if(lang_check == FALSE)
{
llOwnerSay("nessuno.");
}
llOwnerSay(llGetSimulatorHostname());
llSetObjectName(nomeorig);
}
no_sensor()
{
llSetObjectName("");
integer agents = llGetRegionAgentCount();
if(agents == 0)
{
llOwnerSay("llGetRegionAgentCount() riporta 0 Agents,
cosa che non dovrebbe succedere.");
}
else if(agents == 1)
{
llOwnerSay("Non c'e' nessun altro nella sim.");
}
else if(agents == 2)
{
llOwnerSay("C'e' un'altra persona nella sim, ed e' lontana.");
}
else
{
llOwnerSay("Ci sono "
+ (string)(agents-1)
+ " altre persone nella sim, e sono lontane.");
}
llOwnerSay(llGetSimulatorHostname());
llSetObjectName(nomeorig);
}
} </lsl>