Difference between revisions of "Talk:LlGetObjectDetails"

From Second Life Wiki
Jump to navigation Jump to search
(→‎Deeded to Group: new section)
Line 28: Line 28:
             else {
             else {
                 key group = (key)((string)llGetObjectDetails(llGetKey(), [OBJECT_GROUP]));
                 key group = (key)((string)llGetObjectDetails(llGetKey(), [OBJECT_GROUP]));
                 if (groupAdmin || (group == owner)) result = llSameGroup(id);
                 if (groupAdmin || (group == owner)) result =sameGroup;
             }
             }
         }
         }

Revision as of 05:58, 10 September 2012

Caveats state - "An empty list is also returned if the key given was an item in inventory (object or agent)." How exactly can you have an agent in inventory? -- Eddy CUBE jpg.jpgEddy (talk|contribs) 05:46, 20 August 2009 (UTC)

Never mind. Just slightly confusing grammar (fixed). -- Eddy CUBE jpg.jpgEddy (talk|contribs) 05:50, 20 August 2009 (UTC)

Script time: seconds per what?

What, exactly, is the value returned by OBJECT_SCRIPT_TIME? "The total amount of average script CPU time used by the object or agent, in seconds"; but over what period of time is that measured? Per frame? Per second? Surely not the entire lifetime of the script? —The preceding unsigned comment was added on 06:38, 9 October 2011 by Pete Olihenge

I think it is likely time used in the last minute but I could be wrong. It may be the same value as "the average script time per frame for the last 30 minutes for all scripts on the object" Viewerhelp:Top_Colliders_and_Top_Scripts -- Strife (talk|contribs) 11:03, 11 October 2011 (PDT)
It would be nice to pin this down to something specific, but I guess it can only be used as a comparator for now. Thanks. Pete Olihenge 11:41, 11 October 2011 (PDT)
Wot? Maestro put it all right on the OBJECT_SCRIPT_TIME page. It works just like top scripts. Half hour per-frame avg, or per-frame avg since region entry, whichever's shorter. --Incoherendt Randt 13:29, 12 October 2011 (PDT)
Oops! Yeah, I never looked at that. I guess that's as specific as it gets. Thanks, Incoherendt. :) Pete Olihenge 15:47, 12 October 2011 (PDT)

Deeded to Group

I was thinking of adding the following useful snippet somewhere to detect when an object is deeded to group, specifically for determining if an avatar is an object's effective owner, like so: <lsl>integer isOwner(key id, integer groupAdmin) {

   integer result = FALSE;
   {
       key owner = llGetOwner();
       if (id == owner) result = TRUE;
       else { // If object is group owned, avatar need only belong to same group
           integer sameGroup = llSameGroup(id);
           if (groupAdmin) result = sameGroup;
           else {
               key group = (key)((string)llGetObjectDetails(llGetKey(), [OBJECT_GROUP]));
               if (groupAdmin || (group == owner)) result =sameGroup;
           }
       }
   }
   return result;

}</lsl>

I'm trying to decide if this makes sense to add to this article as an example, or if it's better added as a library/user-page function?
-- Haravikk (talk|contribs) 05:20, 10 September 2012 (PDT)