missing llSetText
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
<Solution name="Prim_Counter__Lag_display">
|
<Solution name="Prim_Counter__Lag_display">
|
||||||
<Project name="Prim_Counter__Lag_display" path="Prim_Counter__Lag_display\Prim_Counter__Lag_display.prj" active="true"/>
|
<Project name="Prim_Counter__Lag_display" path="Prim_Counter__Lag_display\Prim_Counter__Lag_display.prj" active="true"/>
|
||||||
</Solution>
|
</Solution>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// :EDITED:2013-09-18 15:39:00
|
// :EDITED:2013-09-18 15:39:00
|
||||||
// :ID:651
|
// :ID:651
|
||||||
// :NUM:887
|
// :NUM:887
|
||||||
// :REV:1.0
|
// :REV:1.1
|
||||||
// :WORLD:Second Life
|
// :WORLD:Second Life
|
||||||
// :DESCRIPTION:
|
// :DESCRIPTION:
|
||||||
// Prim_Counter__Lag_display
|
// Prim_Counter__Lag_display
|
||||||
@@ -38,119 +38,119 @@ string parcel_owner;
|
|||||||
|
|
||||||
string Lag()
|
string Lag()
|
||||||
{
|
{
|
||||||
// Most of this comes from the Second Life LSL Portal [ http://wiki.secondlife.com/wiki/LSL_Portal ]
|
float lag=1-llGetRegionTimeDilation();
|
||||||
|
lag*=100;
|
||||||
|
string lagStr=(string)lag;
|
||||||
|
list cheat=llParseString2List(lagStr,["."],[]);
|
||||||
// And I am sure this could be all be optimized.
|
lagStr=llList2String(cheat,0);
|
||||||
|
string text = lagStr + "%";
|
||||||
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
string FPS()
|
string FPS()
|
||||||
{
|
{
|
||||||
|
float fps=llGetRegionFPS();
|
||||||
float prim_used;
|
string str=(string)fps;
|
||||||
|
list cheat=llParseString2List(str,["."],[]);
|
||||||
float prim_max;
|
str=llList2String(cheat,0);
|
||||||
|
string decimals=llGetSubString(llList2String(cheat,1),0,1);
|
||||||
integer switch;
|
string text = str + "." + decimals;
|
||||||
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getFPS()
|
string getFPS()
|
||||||
{
|
{
|
||||||
|
float fps = llGetRegionTimeDilation();
|
||||||
|
string str = (string)fps;
|
||||||
string Lag()
|
list cheat = llParseString2List(str, ["."], []);
|
||||||
|
str = llList2String(cheat, 0);
|
||||||
{
|
string decimals = llGetSubString(llList2String(cheat, 1), 0, 1);
|
||||||
|
string text = str + "." + decimals;
|
||||||
float lag=1-llGetRegionTimeDilation();
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
string percent(float in)
|
string percent(float in)
|
||||||
{
|
{
|
||||||
|
string str = (string)in;
|
||||||
list cheat=llParseString2List(lagStr,["."],[]);
|
list cheat = llParseString2List(str, ["."], []);
|
||||||
|
str = llList2String(cheat, 0);
|
||||||
lagStr=llList2String(cheat,0);
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
light(integer on) // Set between Green and Black for On and Off.
|
light(integer on) // Set between Green and Black for On and Off.
|
||||||
{
|
{
|
||||||
|
if (on)
|
||||||
}
|
{
|
||||||
|
llSetLinkPrimitiveParamsFast(-2,[PRIM_POINT_LIGHT, TRUE, <0, 1, 0>, 1.0, 0.5, 0.75, PRIM_FULLBRIGHT, ALL_SIDES, TRUE, PRIM_COLOR, ALL_SIDES, <0,1,0>, 1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
string FPS()
|
{
|
||||||
|
llSetLinkPrimitiveParamsFast(-2,[PRIM_POINT_LIGHT, FALSE, <1, 1, 1>, 1.0, 0.5, 0.75, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_COLOR, ALL_SIDES, <0,0,0>, 1]);
|
||||||
{
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
off()
|
off()
|
||||||
{
|
{
|
||||||
|
llSetTimerEvent(0.0);
|
||||||
list cheat=llParseString2List(str,["."],[]);
|
llSetText(" ",<0,0,0>,0);
|
||||||
|
light(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
default
|
default
|
||||||
{
|
{
|
||||||
string text = str + "." + decimals;
|
state_entry()
|
||||||
|
{
|
||||||
return text;
|
llSetTimerEvent(10.0);
|
||||||
|
light(FALSE);
|
||||||
}
|
llSetText("Initializing..",<1,1,1>,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
touch_start(integer total_number)
|
||||||
string getFPS()
|
{
|
||||||
|
//if(llDetectedKey(0)!=llGetOwner())return;//work only for owner
|
||||||
{
|
switch =! switch;
|
||||||
|
if(switch)
|
||||||
float fps = llGetRegionTimeDilation();
|
{
|
||||||
|
llSetTimerEvent(1.0);
|
||||||
string str = (string)fps;
|
}
|
||||||
|
else
|
||||||
list cheat = llParseString2List(str, ["."], []);
|
{
|
||||||
|
off();
|
||||||
str = llList2String(cheat, 0);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timer()
|
||||||
string text = str + "." + decimals;
|
{
|
||||||
|
prim_max = llGetParcelMaxPrims(llGetPos(),FALSE);
|
||||||
return text;
|
prim_ammount = llGetParcelMaxPrims(llGetPos(),FALSE) - llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_TOTAL,FALSE);
|
||||||
|
prim_used = llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_TOTAL,FALSE);
|
||||||
}
|
parcel = llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_NAME,PARCEL_DETAILS_OWNER]);
|
||||||
|
parcel_owner = llKey2Name(llList2Key(parcel,1));
|
||||||
|
|
||||||
|
float percent_used = (prim_used / prim_max) * 100;
|
||||||
|
|
||||||
|
if (percent_used > 90.0) // Set to max percent used before changing color.
|
||||||
{
|
{
|
||||||
|
llSetLinkPrimitiveParamsFast(-2,[PRIM_POINT_LIGHT, TRUE, <0, 1, 0>, 1.0, 0.5, 0.75, PRIM_FULLBRIGHT, ALL_SIDES, TRUE, PRIM_COLOR, ALL_SIDES, <1,0,0>, 1]); // RED
|
||||||
string str = (string)in;
|
}
|
||||||
|
else
|
||||||
list cheat = llParseString2List(str, ["."], []);
|
{
|
||||||
|
light(TRUE);
|
||||||
str = llList2String(cheat, 0);
|
}
|
||||||
|
|
||||||
return str;
|
if(parcel_owner == "")
|
||||||
|
{
|
||||||
}
|
parcel_owner = "(Group Owned)";
|
||||||
|
}
|
||||||
|
llSetText("Parcel Owner: " + parcel_owner + " \n" +
|
||||||
|
"Lag: " + Lag() +
|
||||||
light(integer on) // Set between Green and Black for On and Off.
|
"\nFPS: " + FPS() + "\n" +
|
||||||
|
"Time Dilation: " + getFPS() + "\n" +
|
||||||
{
|
"Max Prims Allowed: " + percent(prim_max) + "\n" +
|
||||||
|
"Prims Used: " + percent(prim_used) + "\n" +
|
||||||
if (on)
|
"Prims Un-used: " + (string)prim_ammount + "\n" +
|
||||||
|
"Percent Used: " + percent(percent_used) + "%",<1.0,1.0,1.0>,1);
|
||||||
{
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project name="Prim_Counter__Lag_display" guid="D8BE45C4-6C00-1014-B904-200204C60A89">
|
<Project name="Prim_Counter__Lag_display" guid="d8be45c4-6c00-1014-b904-200204c60a89">
|
||||||
<Object name="Object" guid="D8BE46B5-6C00-1014-B904-200204C60A89">
|
<Object name="Object" guid="d8be46b5-6c00-1014-b904-200204c60a89">
|
||||||
<Script name="Prim_Counter__Lag_display_1.lsl" guid="D8BE6EE3-6C00-1014-B904-200204C60A89">
|
<Script name="Prim_Counter__Lag_display_1.lsl" guid="d8be6ee3-6c00-1014-b904-200204c60a89">
|
||||||
</Script>
|
</Script>
|
||||||
</Object>
|
</Object>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user