OsGetNpcList

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Added details from OsGetAvatarList, Commit # e53f43, July 26,2017,)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=None
 
|threat_level=None
|function_syntax=
+
|function_syntax=list OsGetNpcList()
|csharp_syntax=
+
|csharp_syntax=LSL_List OsGetNpcList()
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
// Example of osGetNpcList
+
//
 
+
// Example of OsGetNpcList.
 +
//
 
default
 
default
 
{
 
{
     state_entry()
+
     touch_start(integer total_number)
 
     {
 
     {
         ...
+
         list npcs = OsGetNpcList();
 +
        if (npcs == [])
 +
            llSay(0, "You must be the owner. There is nobody else here who could have touched me.");
 +
        else
 +
            llSay(0, "NPC'sin this sim (without avatars): " + llList2CSV(npcs));
 
     }
 
     }
 
}
 
}
 
</source>
 
</source>
|description=...
+
|description=Returns a strided list of the UUID, position, and name of each NPC in the region. Only available after 0.9 Commit # e53f43, July 26,2017
 +
 
 +
This function is similar to [[OsGetAvatarList]].  
 
|
 
|
 
}}
 
}}

Revision as of 08:21, 27 June 2017

list OsGetNpcList()
C#: LSL_List OsGetNpcList()
Returns a strided list of the UUID, position, and name of each NPC in the region. Only available after 0.9 Commit # e53f43, July 26,2017

This function is similar to OsGetAvatarList.

Threat Level None
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
//
// Example of OsGetNpcList.
//
default
{
    touch_start(integer total_number)
    {
        list npcs = OsGetNpcList();
        if (npcs == [])
            llSay(0, "You must be the owner. There is nobody else here who could have touched me.");
        else
            llSay(0, "NPC'sin this sim (without avatars): " + llList2CSV(npcs));
    }
}
Personal tools
General
About This Wiki