Difference between revisions of "LlGetInventoryNumber"

From Second Life Wiki
Jump to navigation Jump to search
m (added example)
m
Line 60: Line 60:
   }   
   }   
}</lsl>
}</lsl>
<pre>objects = llGetInventoryNumber(INVENTORY_OBJECT);</pre>
<lsl>objects = llGetInventoryNumber(INVENTORY_OBJECT);</lsl>
|helpers
|helpers
|also_functions=
|also_functions=
Line 72: Line 72:
|notes
|notes
|permission
|permission
|negative_index
|sort=GetInventoryNumber
|sort=GetInventoryNumber
|cat1=Inventory
|cat1=Inventory

Revision as of 15:55, 24 June 2008

Summary

Function: integer llGetInventoryNumber( integer type );

Returns an integer that is the number of items of a given type in the prims inventory.

• integer type INVENTORY_* flag

Flag Inventory Type
INVENTORY_NONE -1 Item does not exist.
INVENTORY_ALL Any inventory type.
INVENTORY_TEXTURE 0 texture
INVENTORY_SOUND 1 sound
INVENTORY_LANDMARK 3 landmark
INVENTORY_CLOTHING 5 clothing
INVENTORY_OBJECT 6 object
Flag Inventory Type
INVENTORY_NOTECARD 7 notecard
INVENTORY_SCRIPT 10 script
INVENTORY_BODYPART 13 body part
INVENTORY_ANIMATION 20 animation
INVENTORY_GESTURE 21 gesture
INVENTORY_SETTING 56 setting
INVENTORY_MATERIAL 57 material

Examples

<lsl>// Item Counter // // By Apollia Pirandello // // 9/19/2007 // // Public domain. Free to use and/or modify for any purpose, // including commercial purposes. // // Once you drop this script in any prim, it will immediately // tell you in an OwnerSay how many items are in that prim, // minus 1, so the script itself isn't counted. // // It will also do that whenever the prim is touched. //**********SCRIPT BEGINS BELOW**********

//****VARIABLE

integer items_contained;

//****END OF VARIABLE SECTION //****FUNCTIONS****

CountItems() {

 items_contained = llGetInventoryNumber( INVENTORY_ALL );
 --items_contained;

}

SayCount() {

 llOwnerSay( "This prim contains " + (string)items_contained + " items." );

}

//****END OF FUNCTIONS**** //****DEFAULT STATE****

default {

 state_entry()
 {
   CountItems();
   SayCount();
 }
 touch_start(integer total_number)
 {
   CountItems();
   SayCount();
 }  

}</lsl>

<lsl>objects = llGetInventoryNumber(INVENTORY_OBJECT);</lsl>

Deep Notes

Search JIRA for related Issues

Signature

function integer llGetInventoryNumber( integer type );