<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlGetInventoryNumber</id>
	<title>LlGetInventoryNumber - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlGetInventoryNumber"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetInventoryNumber&amp;action=history"/>
	<updated>2026-10-25T11:50:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://wiki.osgrid.org/index.php?title=LlGetInventoryNumber&amp;diff=139&amp;oldid=prev</id>
		<title>Osgridadmin: Created page with &quot;==Function: integer llGetInventoryNumber( integer type );== Returns an integer that is the number of items of a given type in the prims inventory. &lt;br&gt; • integer 	type 	–...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetInventoryNumber&amp;diff=139&amp;oldid=prev"/>
		<updated>2017-12-31T22:26:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Function: integer llGetInventoryNumber( integer type );== Returns an integer that is the number of items of a given type in the prims inventory. &amp;lt;br&amp;gt; • integer 	type 	–...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function: integer llGetInventoryNumber( integer type );==&lt;br /&gt;
Returns an integer that is the number of items of a given type in the prims inventory. &amp;lt;br&amp;gt;&lt;br /&gt;
• integer 	type 	– 	INVENTORY_* flag 	&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;.5&amp;quot; style=&amp;quot;text-align:left&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;black&amp;quot; colspan=&amp;quot;2&amp;quot;| &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Flag  !! bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Inventory Type&lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_NONE || -1 || Item does not exist.&lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_ALL || -1 || Any inventory type. &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_TEXTURE || 0 || texture&lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_SOUND || 1 || sound &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_LANDMARK || 3 || landmark &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_CLOTHING || 5 || clothing &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_OBJECT || 6 || object &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_NOTECARD || 7 || notecard&lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_SCRIPT || 10 || script &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_BODYPART || 13 || body part &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_ANIMATION || 20 || animation &lt;br /&gt;
|-&lt;br /&gt;
| INVENTORY_GESTURE || 21 || gesture &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//                             Item Counter&lt;br /&gt;
//                       By Apollia Pirandello&lt;br /&gt;
//                              9/19/2007&lt;br /&gt;
//&lt;br /&gt;
// Public domain.  Free to use and/or modify for any purpose, &lt;br /&gt;
// including commercial purposes.&lt;br /&gt;
//&lt;br /&gt;
// Once you drop this script in any prim, it will immediately&lt;br /&gt;
// tell you in an OwnerSay how many items are in that prim, &lt;br /&gt;
// minus 1, so the script itself isn&amp;#039;t counted.&lt;br /&gt;
//&lt;br /&gt;
// It will also do that whenever the prim is touched.&lt;br /&gt;
//**********SCRIPT BEGINS BELOW**********&lt;br /&gt;
 &lt;br /&gt;
//****VARIABLE&lt;br /&gt;
 &lt;br /&gt;
integer items_contained;&lt;br /&gt;
 &lt;br /&gt;
//****END OF VARIABLE SECTION&lt;br /&gt;
//****FUNCTIONS****&lt;br /&gt;
 &lt;br /&gt;
CountItems()&lt;br /&gt;
{&lt;br /&gt;
  items_contained = llGetInventoryNumber( INVENTORY_ALL );&lt;br /&gt;
  --items_contained;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
SayCount()&lt;br /&gt;
{&lt;br /&gt;
  llOwnerSay( &amp;quot;This prim contains &amp;quot; + (string)items_contained + &amp;quot; items.&amp;quot; );&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
//****END OF FUNCTIONS****&lt;br /&gt;
//****DEFAULT STATE****&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
  state_entry()&lt;br /&gt;
  {&lt;br /&gt;
    CountItems();&lt;br /&gt;
    SayCount();&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  touch_start(integer total_number)&lt;br /&gt;
  {&lt;br /&gt;
    CountItems();&lt;br /&gt;
    SayCount();&lt;br /&gt;
  }  &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
objects = llGetInventoryNumber(INVENTORY_OBJECT);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Inventory Statistic By Zep Palen.&lt;br /&gt;
// Here is another use of llGetInventoryNumber to show a statistic in a hovertext&lt;br /&gt;
// For this script to work you must add a showlist and an excludelist to the Description of the item this script is in.&lt;br /&gt;
// The description field must be filled like follows: [showlist];[Excludelist]&lt;br /&gt;
// Example: 0,1,3,5,6,7,10,13,20,21;3,7,10&lt;br /&gt;
// in the example all types are shown, but only types 3,7 and 10 are counted as total. You can see in the 2 lists below which number means which type&lt;br /&gt;
// -----------------&lt;br /&gt;
// This script is free to use and modify as you wish - Zep Palen&lt;br /&gt;
// --------------------------&lt;br /&gt;
 &lt;br /&gt;
list inv_types = [0, 1, 3, 5, 6, 7, 10, 13, 20, 21];&lt;br /&gt;
list inv_names = [&amp;quot;Textures&amp;quot;, &amp;quot;Sounds&amp;quot;, &amp;quot;Landmarks&amp;quot;, &amp;quot;Clothings&amp;quot;, &amp;quot;Objects&amp;quot;, &amp;quot;Notecards&amp;quot;, &amp;quot;Scripts&amp;quot;, &amp;quot;Bodyparts&amp;quot;, &amp;quot;Animations&amp;quot;, &amp;quot;Gestures&amp;quot;];&lt;br /&gt;
 &lt;br /&gt;
processCountInventory()&lt;br /&gt;
{&lt;br /&gt;
    list objDesc = llParseString2List(llGetObjectDesc(), [&amp;quot;;&amp;quot;], []);&lt;br /&gt;
    list showList = llParseString2List(llList2String(objDesc, 0), [&amp;quot;,&amp;quot;], []);&lt;br /&gt;
    list excludeFromCount = llParseString2List(llList2String(objDesc, 1), [&amp;quot;,&amp;quot;], []);&lt;br /&gt;
 &lt;br /&gt;
    string counted = &amp;quot;ITEM COUNTER&amp;quot;;&lt;br /&gt;
    integer i = ~llGetListLength(showList);&lt;br /&gt;
    while (++i)&lt;br /&gt;
    {&lt;br /&gt;
        integer showItem = (integer)llList2String(showList, i);&lt;br /&gt;
        integer sIndex = llListFindList(inv_types, [showItem]);&lt;br /&gt;
        if (~sIndex)&lt;br /&gt;
            counted += &amp;quot;\n&amp;quot; + llList2String(inv_names, sIndex) + &amp;quot;: &amp;quot; + (string)llGetInventoryNumber(showItem);&lt;br /&gt;
    }&lt;br /&gt;
    integer totalCount = llGetInventoryNumber(INVENTORY_ALL);&lt;br /&gt;
    for (i = ~llGetListLength(excludeFromCount); ++i;)&lt;br /&gt;
    {&lt;br /&gt;
        integer exclItem = (integer)llList2String(excludeFromCount, i);&lt;br /&gt;
        integer cIndex = llListFindList(inv_types, [(string)exclItem]);&lt;br /&gt;
        if (~cIndex)&lt;br /&gt;
            totalCount = totalCount - llGetInventoryNumber(exclItem);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    counted += &amp;quot;\n \n&amp;quot; + &amp;quot;Total: &amp;quot; + (string)totalCount;&lt;br /&gt;
    llSetText(counted, &amp;lt;1,1,0&amp;gt;, 1);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        processCountInventory();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if (change &amp;amp; CHANGED_INVENTORY)&lt;br /&gt;
        {&lt;br /&gt;
            processCountInventory();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
See Also &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetInventoryName]] 	– 	Returns the inventory item&amp;#039;s name 	&amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetInventoryType]] 	– 	Tests to see if an inventory item exists and returns its type. 	&amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetInventoryCreator]] 	– 	Returns the inventory item&amp;#039;s creator 	&amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetInventoryPermMask]] 	– 	Returns the inventory item&amp;#039;s permissions 	&amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetInventoryKey]] 	– 	Returns the inventory item&amp;#039;s UUID (if full perm) &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Osgridadmin</name></author>
	</entry>
</feed>