Jump to content

Overfill detector HUD


JJValero Writer
 Share

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

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

Recommended Posts

Perhaps anytime, while you working in a sandbox you detected that are you unable to rez prims due anyone is overfilling the sandbox.

This script shows who is overfilling the region. Create a prim with size <0.01000, 0.05000, 0.05000>, put the script inside and wear it as a HUD.

If anyone overfill the sandbox HUD will become red color and send a message saying the name.

This do not detect the conventional fillers or overfillers that do not need to sit on it.


list g_lFillers;

integer isOverFilled(vector vPos) 
{
    integer bResult = FALSE;    
    integer iMaxPrimsT = llGetParcelMaxPrims(vPos, TRUE);
    integer iTotalRe  = llGetParcelPrimCount(vPos, PARCEL_COUNT_TOTAL, TRUE);
    
    if (iTotalRe > iMaxPrimsT) 
    {
        bResult = TRUE;
    }
    return bResult;
}

whoFilling(vector vPos) 
{
    
    integer iMaxPrims = llGetParcelMaxPrims(vPos, TRUE);
    list lAgents = llGetAgentList(AGENT_LIST_REGION, []);
    
    integer iMax = llGetListLength(lAgents);
    integer iCount;

    for (iCount = 0; iCount < iMax; iCount++)
    {
        key kAgent = llList2Key(lAgents, iCount);
        integer iAgentInfo = llGetAgentInfo(kAgent);
        list lDetails = llGetObjectDetails(kAgent, [OBJECT_ROOT, OBJECT_NAME]);
        key kObject = llList2Key(lDetails, 0);
        string sAvatar = llList2String(lDetails, 1);
            
        if (iAgentInfo & AGENT_ON_OBJECT) 
        {
            if (kAgent != kObject) 
            {
                list lObjDetails = llGetObjectDetails(
                    kObject, 
                    [OBJECT_NAME, OBJECT_PRIM_EQUIVALENCE]);
                    
                string sObjName =  llList2String(lObjDetails, 0);
                integer iNPrims = llList2Integer(lObjDetails, 1);
                    
                if (iNPrims > iMaxPrims) 
                {
                    if (llListFindList(g_lFillers, [ kAgent ]) == -1) 
                    {
                        g_lFillers = g_lFillers + [ kAgent ];
                        llOwnerSay(sAvatar + " is overfilling the parcel.");
                    }
                } 
                else 
                {
                    integer iPos = llListFindList(g_lFillers, [ kAgent ]);
                    if (iPos >= 0) 
                    {
                        g_lFillers = llDeleteSubList(g_lFillers, iPos, iPos);
                        llOwnerSay(sAvatar + " stopped overfill the parcel.");
                    }
                }
            }
        }
    }
}

default 
{
    state_entry() 
    {
        g_lFillers = [];
        llSetTimerEvent(2.0);    
    }
    
    on_rez(integer start_param) 
    {
        g_lFillers = [];
    }

    timer() 
    {
        vector vPos = llGetPos();
        if (isOverFilled(llGetPos()) == TRUE) 
        {
            llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES);
            whoFilling(vPos);
        }
        else 
        {
            llSetColor(<0.0, 1.0, 0.0>, ALL_SIDES);
            if (llGetListLength(g_lFillers) > 0) 
            {
                whoFilling(vPos);
            }
        }
    }
    
    changed(integer change) 
    {
        if ((change & CHANGED_REGION) == CHANGED_REGION) 
        {
            g_lFillers = [];
        }
    }

}

 

Link to comment
Share on other sites

  • 3 weeks later...

The timer triggers every two seconds. If person A rezzed 999 L.I. in one time slice and person B rezzed 2 L.I. in the next one, the answer is easy. The script sees only person B in the time slice that hit the limit.  If both people rezzed items within the same 2-second time slice, it's a crap shoot. The WhoFilling function loops through the list that is created by llGetAgentList, and there's no way to predict which person's UUID will be the second one in that list (the one that will trigger the warning).  The equitable way to solve the problem is to save both names and to warn you about both people when the for loop terminates.  In practice, of course, when the region is nearly full anyone who rezzes anything will trigger the warning. If it's a busy sandbox, results could be confusing.  ;)

  • Thanks 1
Link to comment
Share on other sites

Resi, nothing of two. Only will report anyone sitted on a NPV with more of 1000 prims.

Overfillers usually are NPV (Non Physical Vehicle) that can have a land impact above 20.000 Land Impact. A very popular one have exactly 100.000 LI and there are others  of several millions.

Usually overfillers are used in big sandboxes. Many times as a defence in order to avoid grieffers attacks, but a grieffer can use too an overfiller to disable the region for hours and hours. That is, it is a double-edged knife.

Overfillers are like the sprays that were invented to prevent women being raped. But the rapists used them too. And they were removed from the market.

 

ampliation

Of course, if you are the owner of a sandbox you can use scripts using "llGetParcelPrimOwners()"

 

 

Edited by JJValero Writer
Ampliation
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2274 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...