Jym_Nova icon

VisitorList&Counter

Jym_Nova | PRO | 10/24/14 03:17:34 AM UTC | 0 ⭐ | 868 👁️ | Never ⏰ | []
Linden Scripting |

0 B

|

None

|

0 👍

/

0 👎

// Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
/* 
LICENCE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
 
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/>.
or you may visit - http://license.idjhost.com/
*/
// DESCRIPTION
/*
Free visitor list and counter for all that need or want it
Give it away free full perm and open source but don't sell it!!!
*/
 
list visitors;
 
integer IsInList(list data, string name)
{
    integer i;
    for(i=0;i<llGetListLength(data);i++)
    {
        if(llList2String(data,i)==name)
        {
            return TRUE;
        }
    }
    return FALSE;
}
 
TypeOutList()
{
    llOwnerSay("There are "+(string)llGetListLength(visitors)+" names in the visitors list.\nThe names currently in the list are as follows:\n "+llList2CSV(visitors));
    llOwnerSay("You have "+(string)llGetFreeMemory()+" memory free.");
}
 
default
{
    state_entry()
    {
        llSetTimerEvent(15);
    }
    touch_start(integer total_number)
    {
        if(llDetectedKey(0) == llGetOwner())
        {
            TypeOutList();
        }
        /*else if(llDetectedKey(0) == "you can enter a managers UUID here")
        {
            TypeOutList();
        }*/ remove these words and the comment symbols if you want a manager to be able to check the list
    }
    timer()
    {
        list avatarsInRegion = llGetAgentList(AGENT_LIST_PARCEL, []);
        integer numOfAvatars = llGetListLength(avatarsInRegion);
        integer detected;
        integer index;
        integer i;
        if (!numOfAvatars)
        {
            llOwnerSay("No avatars found within the region!");
            return;
        }
        while (index < numOfAvatars)
        {
            key id = llList2Key(avatarsInRegion, index);
            string name = llKey2Name(id);
            if(IsInList(visitors, llKey2Name(id)))
            {
                //llOwnerSay("Everyone on parcel have already been added.");
            }
            else
            {
                visitors += llKey2Name(id);
                llOwnerSay("Added "+(string)name);
            }
            ++index;
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎