OsGetNpcList

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Add Author)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=None
 
|threat_level=None
 +
|permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
 +
|delay=0
 
|function_syntax=list osGetNPCList()
 
|function_syntax=list osGetNPCList()
|csharp_syntax=LSL_List osGetNPCList()
 
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
//
 
//
// Example of osGetNPCList.
+
// osGetNPCList Script Exemple
 +
// Author: djphil
 
//
 
//
 +
 
default
 
default
 
{
 
{
     touch_start(integer total_number)
+
    state_entry()
 +
    {
 +
        llSay(PUBLIC_CHANNEL, "Touch to see osGetNPCList usage.");
 +
    }
 +
 
 +
     touch_start(integer number)
 
     {
 
     {
 
         list npcs = osGetNPCList();
 
         list npcs = osGetNPCList();
 +
 
         if (npcs == [])
 
         if (npcs == [])
             llSay(0, "You must be the owner. There is nobody else here who could have touched me.");
+
        {
 +
             llSay(PUBLIC_CHANNEL, "There is no NPC's in this sim currently.");
 +
        }
 +
 
 
         else
 
         else
             llSay(0, "NPC's in this sim (without avatars): " + llList2CSV(npcs));
+
        {
 +
             llSay(PUBLIC_CHANNEL, "NPC's in this sim (without avatars): " + llList2CSV(npcs));
 +
        }
 
     }
 
     }
 
}
 
}
Line 22: Line 36:
  
 
This function is similar to [[OsGetAvatarList]].  
 
This function is similar to [[OsGetAvatarList]].  
|
+
|additional_info=This function was added in 0.9.0.1}}
}}
+

Latest revision as of 11:22, 3 December 2020

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 ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
//
// osGetNPCList Script Exemple
// Author: djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osGetNPCList usage.");
    }
 
    touch_start(integer number)
    {
        list npcs = osGetNPCList();
 
        if (npcs == [])
        {
            llSay(PUBLIC_CHANNEL, "There is no NPC's in this sim currently.");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "NPC's in this sim (without avatars): " + llList2CSV(npcs));
        }
    }
}
Notes
This function was added in 0.9.0.1
Personal tools
General
About This Wiki