Difference between revisions of "Ultimate Radar"
Jump to navigation
Jump to search
(Created page with "{{LSL Header}} Category:LSL_Library <div style="padding-left: 0.3em"> Teleporter_Anywhere | Ultimate_Radar | Language_Scanner | Visitor_Counter_Tracker </d...") |
(Remove Copyright) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
[[Category:LSL_Library]] | [[Category:LSL_Library]] | ||
<div | <div> | ||
[[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]] | [[User:Luxen_Resident]] | [[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]] | ||
</div> | </div> | ||
<div id="box"> | <div id="box"> | ||
== | ==Summary== | ||
<div style="padding: 0.5em | <div style="padding: 0.5em;"> | ||
An advanced radar to detect avatars and their language on an entire region. | |||
</div></div> | </div></div> | ||
<div id="box"> | <div id="box"> | ||
== Code: == | == Code: == | ||
< | <div style="padding: 0.5em;"> | ||
<source lang="lsl2"> | <source lang="lsl2"> | ||
////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////// | ||
// Zx Ultimate Radar Hud v5 // | // Zx Ultimate Radar Hud v5 // | ||
// // | // // | ||
// | // By Luxen - Zonyx Technology // | ||
////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////// | ||
Line 147: | Line 123: | ||
{ | { | ||
DLang = llGetAgentLanguage(id); | DLang = llGetAgentLanguage(id); | ||
integer Dlenght = llStringLength(DLang); | |||
if (Dlenght == 2) ; | |||
else if (Dlenght == 5) | |||
{ | { | ||
if (DLang == "en-us") DLang = "en"; | if (DLang == "en-us") DLang = "en"; | ||
else DLang = "xx"; | else DLang = "xx"; | ||
} | } | ||
else DLang = "xx"; | |||
} | } | ||
else DName = "???"; | else DName = "???"; | ||
Line 192: | Line 171: | ||
} | } | ||
</source> | </source> | ||
</div></div> |
Latest revision as of 16:43, 18 January 2017
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
User:Luxen_Resident | Teleporter_Anywhere | Ultimate_Radar | Language_Scanner | Visitor_Counter_Tracker
Summary
An advanced radar to detect avatars and their language on an entire region.
Code:
//////////////////////////////////////////////////////////////////////////////
// Zx Ultimate Radar Hud v5 //
// //
// By Luxen - Zonyx Technology //
//////////////////////////////////////////////////////////////////////////////
integer counter = 0;
key owner = NULL_KEY;
integer RStat = TRUE;
set_time(float Stime, string Stext, integer Scounter)
{
llSetText(Stext, <0.667, 0.667, 0.667>, 1.0);
if (Stime != 5.0) llSetTimerEvent(Stime);
counter = Scounter;
}
default
{
state_entry()
{
if(owner) ;
else
{
llSetMemoryLimit(40000);
owner = llGetOwner();
set_time(10.0, "[- Starting -]", 0);
}
}
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
if(change & (CHANGED_REGION)) state teleport;
}
touch_start(integer total_number)
{
if (llGetAttached())
{
if (counter)
{
set_time(0.0, "[- Off -]", 0);
RStat = FALSE;
}
else if (!RStat)
{
set_time(10.0, "[- Starting -]", 0);
RStat = TRUE;
}
}
}
timer()
{
list AvatarsDetect = llGetAgentList(AGENT_LIST_REGION, []);
integer numOfAvatars = llGetListLength(AvatarsDetect);
if (!llGetAttached())
{
if (llGetObjectPrimCount(llGetKey()))
{
set_time(0.0, "[- Off -]", 0);
RStat = FALSE;
}
}
else if (numOfAvatars < 2)
{
if (counter != 2) set_time(5.0, "[- Nobody -]", 2);
}
else if (numOfAvatars > 100) return;
else
{
integer index;
list NewTab = [];
vector currentPos = llGetPos();
integer Zfix = numOfAvatars;
for (index = 0; index < Zfix; ++index)
{
key AvKey = llList2Key(AvatarsDetect, index);
list AvPos = llGetObjectDetails(AvKey, [OBJECT_POS]);
if (AvPos) NewTab += [llVecDist(currentPos, llList2Vector(AvPos, 0)), AvKey];
else --numOfAvatars;
}
if (numOfAvatars > 1)
{
AvatarsDetect = [];
NewTab = llListSort(NewTab, 2, TRUE);
string mode = "[- Sim: " + (string)(numOfAvatars -1) + " -]";
numOfAvatars *= 2;
for(index = 0; index < numOfAvatars; index += 2)
{
key id = llList2Key(NewTab, index + 1);
if (Zfix)
{
if (id == owner)
{
Zfix = FALSE;
jump Ignore;
}
}
string DName = llGetUsername(id);
string DLang = "?";
if (DName)
{
DLang = llGetAgentLanguage(id);
integer Dlenght = llStringLength(DLang);
if (Dlenght == 2) ;
else if (Dlenght == 5)
{
if (DLang == "en-us") DLang = "en";
else DLang = "xx";
}
else DLang = "xx";
}
else DName = "???";
DName += " (" + DLang + "-" + (string)llList2Integer(NewTab, index) + "m)";
if (index > 18)
{
DName = mode + "\n" + DName;
if (llStringLength(DName) > 254) jump affich;
else mode = DName;
}
else mode += "\n" + DName;
@Ignore;
}
@affich;
NewTab = [];
set_time(5.0, mode, 1);
}
}
}
}
state teleport
{
state_entry()
{
if (counter) set_time(10.0, "[- Searching -]", 0);
state default;
}
on_rez(integer start_param)
{
llResetScript();
}
timer()
{
return;
}
}