Difference between revisions of "Ultimate Radar"

From Second Life Wiki
Jump to navigation Jump to search
(Remove Copyright)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{LSL Header}}
{{LSL Header}}
[[Category:LSL_Library]]
[[Category:LSL_Library]]
<div style="padding-left: 0.3em">
<div>
[[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]]
[[User:Luxen_Resident]] | [[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]]
</div>
</div>
==Zx Ultimate Radar==
<div id="box">
<div style="padding: 0.5em 0.5em 1.5em">
An advanced radar to detect users and their language on an entire region without any lag.
You can test it in Full Sim: it's not a problem for it.
* Copyright (C) 2016 Luxen - [[User:Luxen_Resident|Luxen_Resident]] - version 5.0
* Optimized: tested with more 90 users, low memory, safe and secure
</div></div>
<div id="box">
<div id="box">
==History==
==Summary==
<div style="padding: 0.5em 0.5em 1.5em">
<div style="padding: 0.5em;">
* I created the first version 3 years ago and I sold different versions on ''MarketPlace''.
An advanced radar to detect avatars and their language on an entire region.  
* Optimized and tested for 3 years.
* I tried to create the perfect SL radar but i understood something: At each version was thinking it was perfect but some months later not. So it's my 2016 SL radar version.
</div></div>
</div></div>
<div id="box">
<div id="box">
== Code: ==
== Code: ==
</div>
<div style="padding: 0.5em;">
<source lang="lsl2">
<source lang="lsl2">
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//                      Zx Ultimate Radar Hud  v5                          //
//                      Zx Ultimate Radar Hud  v5                          //
//                                                                          //
//                                                                          //
//   Copyright (C) 2016 Luxen - Zonyx Technology                           //
//                     By Luxen - Zonyx Technology                          //
//    This program is free software: you can redistribute it and/or modify  //
//    it under the terms of the GNU General Public License version 3, as    //
//    published by the Free Software Foundation.                            //
//                                                                          //
//    This program is distributed in the hope that it will be useful,      //
//    but WITHOUT ANY WARRANTY; without even the implied warranty of        //
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        //
//    GNU General Public License for more details.                         //
//                                                                          //
//  You should have received a copy of the GNU General Public License      //
//    along with this program.  If not, see <http://www.gnu.org/licenses/>  //
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////


Line 149: Line 123:
                     {
                     {
                         DLang = llGetAgentLanguage(id);
                         DLang = llGetAgentLanguage(id);
                         if (llStringLength(DLang) !2)
                         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 194: Line 171:
}
}
</source>
</source>
</div></div>

Latest revision as of 16:43, 18 January 2017

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