Jump to content

Change hover text to chat in prim count script


Janford Flax
 Share

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

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

Recommended Posts

Love this script but I would like it to say the list in chat instead of scrolling it in hover text.  I got it to say it in chat but it repeats the list as many times as there are prim owners, adding one person at a time until it repeats the whole list, instead saying the  whole list at once just once.  Clearly I'm not a scripter.  But if someone could help that would be great.  Thanks!

http://wiki.secondlife.com/wiki/LlGetParcelPrimOwners

 

// Show a floating text list of prim owners on this parcel,
// Sorted by prim count per owner. Highest users first.
// Omei Qunhua
 
// The object has the same permisions to view prim parcel owners
// as its owner (In About Land >> Objects >> Object Owners )
 
// Example: If you can't return group object, you won't see group objects
// If you can't return any objects, an empty list will be returned.
// If the prim is deeded to the right group, it should always get a full list
 
// Note: Only works on group owned land when the object owner is in the Sim
//       Deeded objects always work (group is always online?)
 
list    gListCountsAndOwners;       // Sorted list count+owner pairs
list    gListNamesAndCounts;        // List of owner names + prim counts
integer gOffset;
integer gIndex;
key     gDataserverID;
integer gListLength;
 
default
{
    state_entry()
    {
        llSetText("Parcel Prim Owner List\n", <1,1,1>, 1);
        list TempList = llGetParcelPrimOwners( llGetPos() );
        gListLength= llGetListLength(TempList);      
        if (!gListLength)
        {
            llSetText("[ERROR]\n Couldn't get Parcel Prim Owners", <1,0,0>, 1);
        }
        else
        {
            // Produce a copy of the list suitable for sorting by count, i.e. count then key 
            integer x;
            for ( ; x < gListLength; x += 2)
            {
                gListCountsAndOwners += llList2Integer(TempList, x+1);
                gListCountsAndOwners += llList2String(TempList, x);
            }
            // Sort the list in descending order of prim count
            gListCountsAndOwners = llListSort(gListCountsAndOwners, 2, FALSE);
            // Lookup each owner's name. Start at the beginning of our sorted list
            gDataserverID = llRequestAgentData( llList2String(gListCountsAndOwners, 1), DATA_NAME );
        }
    }
 
    dataserver( key request_id, string data)
    {
        string TempStr = "Parcel Prim Owner List\n";
        if ( request_id == gDataserverID )
        {
            gListNamesAndCounts += data;
            gListNamesAndCounts += llList2String(gListCountsAndOwners, gIndex);  // process the count as a string
 
            gIndex += 2;               // bump through the strided list
            if (gIndex < gListLength )
            {
                // lookup name of next owner in our list
                gDataserverID = llRequestAgentData( llList2String(gListCountsAndOwners, gIndex +1) , DATA_NAME );
            }
            integer x;
            for (; x < 16; x+=2)       // show an 8-name subset of the list, starting at 'gOffset'
            {
                // If we run off the end of the list, we just pick up nulls, so no harm done
                TempStr += llList2String(gListNamesAndCounts, gOffset+x) + " : " + llList2String(gListNamesAndCounts, gOffset+x+1) + "\n";
            }
            llSetText(TempStr, <1,1,1>, 1);
            if ( (gListNamesAndCounts != []) > 14)       // If list is longer than 14 (7 owners + counts) ...
            {
                gOffset += 2;   // scroll the list forwards
                llSleep(2);     // at 2 second intervals
            }
        }
    }
 
    touch_start(integer total_number)
    {
        llResetScript();        // On touch, start the whole process over again
    }
}

 

Link to comment
Share on other sites

This isn't the place to ask for someone to rewrite someone else's script for you, but fortunately, there's an easier solution anyway .  Take a look at https://community.secondlife.com/t5/LSL-Library/For-Parcel-Owners-Display-Parcel-Prim-Ownership/m-p/827525

Read the conversation in that thread too. There were good changes in the discussion.

Link to comment
Share on other sites

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