Jump to content

Who can tweak this script please?


Baron Garzo
 Share

You are about to reply to a thread that has been inactive for 1583 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

This script will teleport home users from parcels when they are below a certain age.

integer AGE_LIMIT;
list agent_list;
 
integer date2days(string data)
{
    integer result;
    list parse_date = llParseString2List(data, ["-"], []);
    integer year = llList2Integer(parse_date, 0);
 
    result = (year - 2000) * 365; // Bias Number to year 2000 (SL Avatars Born After Date)
    list days = [ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ];
 
    result += llList2Integer(days, (llList2Integer(parse_date, 1) - 1));
    if (year/4 == llRound(year/4)) result += 1;
    result += llList2Integer(parse_date, 2);
 
    return result;
}
 
default
{
    on_rez(integer param)
    {
        llResetScript();
    }
 
    state_entry()
    {
        AGE_LIMIT = (integer)llGetObjectDesc();
 
        if (AGE_LIMIT < 2)
        {
            AGE_LIMIT = 2;
        }
 
        llSetObjectName("Unknown Underage Boot - " + llGetRegionName());
        llVolumeDetect(TRUE);
        if (llOverMyLand(llGetKey()) == FALSE)
        {
            llSay(0, "Requires proper group deeds to work on this land.");
        }
        llSensorRepeat("", "", AGENT, 100.0, PI, 1.0);
        llOwnerSay("Set Avatar age in the description, currently it is set for " +
            (string)AGE_LIMIT + " days.");
    }
 
    sensor(integer num_detected)
    {
        if (llOverMyLand(llGetKey()) == FALSE)
        {
            return;
        }
 
        integer i;
 
        for (i = 0; i < num_detected; i++)
        {
            key agent = llDetectedKey(i);
            if (llSameGroup(agent) == FALSE)
            {
                if (llListFindList(agent_list, [ agent ]) < 0)
                {
                    if (llGetListLength(agent_list) == 0)
                    {
                        agent_list += agent;
                        llRequestAgentData(llList2Key(agent_list, 0), DATA_BORN);
                    }
                    else
                    {
                        agent_list += agent;
                    }
                }
            }
        }
    }
 
    dataserver(key queryid, string data)
    {
        AGE_LIMIT = (integer)llGetObjectDesc();
 
        integer today = date2days(llGetDate());
        integer age = date2days(data);
        key agent = llList2Key(agent_list, 0);
        string name = llKey2Name(agent);
 
        if (AGE_LIMIT < 2)
        {
            AGE_LIMIT = 2;
            llSetObjectDesc((string)AGE_LIMIT + " : SET AGE LIMIT HERE");
        }
 
        if (name != "")
        {
            if ((today - age) < AGE_LIMIT)
            {
                if (llOverMyLand(agent))
                {
                    llSay(0, name + ", you are too young to be here.");
                    llTeleportAgentHome(agent);
                }
            }
            else
            {
            }
        }
        else
        {
            llTeleportAgentHome(agent);
        }
 
        agent_list = llDeleteSubList(agent_list, 0, 0);
        if (llGetListLength(agent_list) != 0)
        {
            llRequestAgentData(llList2Key(agent_list, 0), DATA_BORN);
        }
    }
}

I would need the following tweak to this script so that the script bans and teleport home avatars below a certain age on any parcel in the region.

I am region owner so when I place down an Object containing this script any avatar who attempts to come in the region below a certain age needs to be placed on the sim ban list and teleported to their home.

The following LSL functions should be able to do this:

llManageEstateAccess

 

in combination with ESTATE_ACCESS_BANNED_AGENT_ADD

The LLOverMyLand function in this script should be removed. For anyone who is able to code this should be easy to fix the script.

*** Script should work on a sim that is subdevided into parcels with different owners and groups. This script should only work for the sim owner or Estate Manager (what is most easy to implement) so it will override and control all the parcels on the region.

Thank you

Link to comment
Share on other sites

There is very little to no documentation about this on the LSL wiki. After spending a decent amount to search for examples in which these functions are used I could not find anything.

I also want the script to be available to the community as it can seriously help to combat griefing by newly created alts.

There is no option in the Estate Panel to restrict age access to the simulator.

42 minutes ago, Wulfie Reanimator said:

It's been a good few years since I was an estate manager, but can't you limit the minimum age allowed for a sim without scripts?

Or at least on the parcel level, so you could make your landing area its own parcel and everything outside of it age-restricted?

Griefing by the use of fresh created alts is a long term plague. In theory a sim owner should be able to set age restrictions in the Estate panel but Linden Lab did not see the need to implement this.

Coders who want to help with this anti griefing tool are welcome to post their attempts.

*Script needs to Estate ban and teleport home any alt below the age limit set the moment the underage avatar enters the sim.

 

Thank you

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1583 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...