Jump to content

For Parcel Owners -- Display Parcel Prim Ownership


Rolig Loon
 Share

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

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

Recommended Posts

This is a very simple idea, and it's a common request from landowners: "Who owns all the prims on my parcel?"  You can use About Land to get the answer, of course, but some people like to display the information publicly.  This script does it with a hovertext display and will also send the information in chat if you click on it.  Just rez an attractive prim and drop the script into it.

 

// Parcel Prim Ownership  --  Rolig Loon  -- April 2011
//
// This script should be handy if you own a parcel and want to let people see how its
//   prim allowance is being used.
// This script will only work if you have an Owner or "owner-like" role in the group that
//   owns the parcel.
// Due to length limitations of strings displayed in hover text, you may find that a very
//   long list of prim owners is truncated.  In that case, you can still see the complete
//   list in chat by touching the object.
// The script will update its display once an hour -- a period that could easily be changed
//   if the number of prims in your parcel changes more (or less) frequently.

list WhoHas = [];
key gQname;
string text;
integer count;

default
{
    on_rez(integer startup)
    {
        llResetScript();
    }
    
    state_entry()
    {
        llSetTimerEvent(3600.0); // Update display once an hour
        count = 0;
        text =  "Total prims on this Parcel = " + (string)llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_TOTAL,TRUE);
        text = text + "\n Prims set to or owned by group = " + (string)llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_GROUP,TRUE);
        text = text + "\n Individually owned = ";
        llSetText(text,<1.0,1.0,1.0>,1.0);
        WhoHas = llGetParcelPrimOwners(llGetPos());
        gQname = llRequestAgentData((key)llList2String(WhoHas,0),DATA_NAME);
    }
    
    dataserver(key id, string data)
    {
        if(id == gQname)
        {
            text = text + "\n" + data + " : " + llList2String(WhoHas,count + 1);
            count = count + 2;
            if(count < llGetListLength(WhoHas))
            {
                gQname = llRequestAgentData(llList2Key(WhoHas,count),DATA_NAME);
            }
        }
        llSetText(text,<1.0,1.0,1.0>,1.0);
    }

    touch_start(integer num)
    {
        llSay(0,text);
    }

    timer()
    {
        llResetScript();
    }
}

 

 

Link to comment
Share on other sites

you'll want to include a timeout for the agent request, as requesting the name on a group owned obect with llRequestAgentData fails silently on group owned objects.

deeding the script to the land group (if the land is group owned) gives full permissions for the prim owners function...

remind me to send you a copy of my ghost prim detector, which also pushes out the parcel prim list.

Link to comment
Share on other sites

 


Void Singer wrote:

you'll want to include a timeout for the agent request, as requesting the name on a group owned obect with llRequestAgentData fails silently on group owned objects.

True, llRequestAgentData does fail if you feed it a group UUID.  In this case, though, that's not much of a problem because the group is the only entity whose UUID will fail and it's easy to figure out how many prims are owned exclusively by the group. We get the total number of prims in the sim by asking for PARCEL_COUNT_TOTAL, which is reported as the first line of the hover text.  Any prims that are not included in the individual counts listed later obviously belong to the group.  It's the second line that I find confusing, in retrospect.  PARCEL_COUNT_GROUP reports "prims not owned by the owner, but set to or owned by the group of the parcel."  It would be smarter on that line to report PARCEL_COUNT_TOTAL  minus the sum of individually owned prims.  I can do that with this version ......

 

 
list WhoHas = [];key gQname;string text;integer count;integer NonGroup;default{    on_rez(integer startup)    {        llSetText("Hello?",<1.0,1.0,1.0>,1.0);        llResetScript();    }        state_entry()    {        NonGroup = 0;        count = 0;        text = "";        llSetText(text,<1.0,1.0,1.0>,1.0);        WhoHas = llGetParcelPrimOwners(llGetPos());        llSay(0, llList2CSV(WhoHas));        key Group = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);        llSay(0,(string)Group);        integer idx = llListFindList(WhoHas,[Group]);        if(~idx)        {            WhoHas = llDeleteSubList(WhoHas,idx,idx+1);        }        gQname = llRequestAgentData((key)llList2String(WhoHas,0),DATA_NAME);    }        dataserver(key id, string data)    {        if(id == gQname)        {            text = text + "\n" + data + " : " + llList2String(WhoHas,count + 1);            NonGroup = NonGroup + llList2Integer(WhoHas,count+1);            count = count + 2;            if(count < llGetListLength(WhoHas))            {                gQname = llRequestAgentData(llList2Key(WhoHas,count),DATA_NAME);            }            else            {                integer TotalPrims = llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_TOTAL,FALSE);                string Pretext =  "Total prims on this Parcel = " + (string)TotalPrims;                Pretext = Pretext + "\n Owned by group = " + (string)(TotalPrims -NonGroup);                Pretext = Pretext + "\n Individually owned = ";                text = Pretext + text;                llSetText(text,<1.0,1.0,1.0>,1.0);            }        }    }}

 ETA: Added a snippet to remove information about items owned exclusively by the group before looking for the names of object owners.

2nd Edit: Corrected typo in script

 

 

Link to comment
Share on other sites

problem is it stops on the first group key, which isn't guaranteed to be the last parcel owner. and also while it's not common there can be deeded items that are not owned by the parcel group..... it's a serious headache... I think there's a jira in to request agent data return something for non-avatar keys...

I'm posting my Ghost  Prim utility, so you'll be able to see what I did for jumping the group owned items... unfortunately it's not going to help much unless you multiplex the timer, or cheat a timer out of llSensorRepeat

ps:
you may want to use false to limit the count to the current parcel, since that's all parcel owners will return, and you may also want to ad a call to get the temp count (since those also include sat-upon and selected prims)

Link to comment
Share on other sites

 


Void Singer wrote:

problem is it stops on the first group key, which isn't guaranteed to be the last parcel owner. and also while it's not common there can be deeded items that are not owned by the parcel group..... it's a serious headache... I think there's a jira in to request agent data return
something
for non-avatar keys...

 

Ah.... I see your point.  I had discounted that as an issue because in my trials on all parcels where I have an owner-like role, the group is the last parcel owner.  I assumed that was the norm, so having a dataserver failure at that point was unimportant.  If that's not the case, then yes, it makes sense to build in a timeout.

Of course, there is an easier solution.  In state_entry, instead of jumping over group-owned items, just strip out any group owned data before processing the WhoHas list of parcel prim owners to get names.  Something like ...

 

        WhoHas = llGetParcelPrimOwners(llGetPos());        key Group = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);        integer idx = llListFindList(WhoHas,[Group]);        if(~idx)        {            WhoHas = llDeleteSubList(WhoHas,idx,idx+1);        }

 Yes, that assumes that there's only one group that owns prims on the parcel, and that the detecting prim is set to that group.  My guess is that in 99.99% of the cases those are safe enough assumptions, though, and this is easier than multiplexing a timer.  I'll edit my second script to include this update.

 

Link to comment
Share on other sites

  • 6 years later...

The code for the update in the third (April 22, 2011) post in this thread was made unreadable when the forums were redesigned in 2017.  Here's a clean version of that script, with no further changes of any kind:

list WhoHas = [];

key gQname;

string text;

integer count;

integer NonGroup;

default

{

    on_rez(integer startup) 
    { 
        llSetText("Hello?",<1.0,1.0,1.0>,1.0); 
        llResetScript(); 
    } 
    
    state_entry() 
    { 
        NonGroup = 0; 
        count = 0; 
        text = ""; 
        llSetText(text,<1.0,1.0,1.0>,1.0); 
        WhoHas = llGetParcelPrimOwners(llGetPos()); 
        llSay(0, llList2CSV(WhoHas));
        key Group = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);
        llSay(0,(string)Group); 
        integer idx = llListFindList(WhoHas,[Group]);
        if(~idx) 
        { 
            WhoHas = llDeleteSubList(WhoHas,idx,idx+1); 
        } 
        gQname = llRequestAgentData((key)llList2String(WhoHas,0),DATA_NAME); 
    } 
    
    dataserver(key id, string data) 
    { 
        if(id == gQname) 
        { 
            text = text + "\n" + data + " : " + llList2String(WhoHas,count + 1); 
            NonGroup = NonGroup + llList2Integer(WhoHas,count+1); 
            count = count + 2; 
            if(count < llGetListLength(WhoHas)) 
            { 
                gQname = llRequestAgentData(llList2Key(WhoHas,count),DATA_NAME); 
            } 
            else 
            { 
                integer TotalPrims = llGetParcelPrimCount(llGetPos(),PARCEL_COUNT_TOTAL,FALSE);
                string Pretext = "Total prims on this Parcel = " + (string)TotalPrims; Pretext = Pretext + "\n Owned by group = " + (string)(TotalPrims -NonGroup); 
                Pretext = Pretext + "\n Individually owned = "; 
                text = Pretext + text; 
                llSetText(text,<1.0,1.0,1.0>,1.0); 
            } 
        } 
    }
}

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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