Difference between revisions of "LlGetAgentList"

From Second Life Wiki
Jump to: navigation, search
m
m (Update API name to llGetRegionAgents)
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
 
|inject-2={{Issues/SVC-5488}}{{Issues/MISC-243}}{{LSL_Function/avatar|avatar|sim=*}}
 
|inject-2={{Issues/SVC-5488}}{{Issues/MISC-243}}{{LSL_Function/avatar|avatar|sim=*}}
|func=llGetAgentList
+
|func=llGetRegionAgents
|sort=GetAgentList
+
|sort=GetRegionAgents
 
|func_id
 
|func_id
 
|func_sleep=0
 
|func_sleep=0
Line 31: Line 31:
 
         integer  liCount;
 
         integer  liCount;
 
 
         gaAgents = llGetAgentList(AGENT_LIST_REGION, []);
+
         gaAgents = llGetRegionAgents();
 
         liCount = llGetListLength(gaAgents);
 
         liCount = llGetListLength(gaAgents);
 
         if (liCount > 0)
 
         if (liCount > 0)

Revision as of 13:57, 26 April 2012

Emblem-important-red.png Pre-release Documentation Warning!

This function is not available yet. This documentation was written prior to its final release so it may not match the final implementation.

Summary

Function: list llGetRegionAgents( integer scope, list options );

Requests a list of agents currently in the region, limited by the scope parameter.
Returns a list [key id0, key id1, ..., key idn] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope

• integer scope selection scope
  • AGENT_LIST_PARCEL - returns only agents on the same parcel where the script is running.
  • AGENT_LIST_PARCEL_OWNER - returns only agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object.
  • AGENT_LIST_REGION - returns any/all agents in the region.
• list options Unused.

Caveats

  • There is no guaranteed understandable order or randomness to the list returned.
  • Will only return up to 100 agents.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>//Displays up to 100 avatar key: name pairs detected in the entire region list gaAgents;

default {

   touch_start(integer total_number)
   {
       integer  i;
       integer  liCount;
       gaAgents = llGetRegionAgents();
       liCount = llGetListLength(gaAgents);
       if (liCount > 0)
           if (llGetListEntryType(gaAgents,0) == TYPE_STRING)
               llOwnerSay("Error: "+llList2String(gaAgents,0));
           else
               for (i=0; i < liCount; ++i)
                   llOwnerSay(llList2String(gaAgents,i)+": "+llKey2Name(llList2String(gaAgents,i)));
  }
}</lsl>

See Also

Deep Notes

History

Search JIRA for related Issues

Signature

function list llGetRegionAgents( integer scope, list options );