<?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=LlGetInventoryType</id>
	<title>LlGetInventoryType - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlGetInventoryType"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetInventoryType&amp;action=history"/>
	<updated>2026-10-25T11:50:15Z</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=LlGetInventoryType&amp;diff=141&amp;oldid=prev</id>
		<title>Osgridadmin: Created page with &quot;==Function: integer llGetInventoryType( string name );== Returns an integer that is the type of the inventory item name &lt;br&gt; • string 	name 	– 	name of an inventory item...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetInventoryType&amp;diff=141&amp;oldid=prev"/>
		<updated>2017-12-31T22:27:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Function: integer llGetInventoryType( string name );== Returns an integer that is the type of the inventory item name &amp;lt;br&amp;gt; • string 	name 	– 	name of an inventory item...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function: integer llGetInventoryType( string name );==&lt;br /&gt;
Returns an integer that is the type of the inventory item name &amp;lt;br&amp;gt;&lt;br /&gt;
• string 	name 	– 	name of an inventory item 	 &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
If the item does not exist, [[INVENTORY_NONE]] is returned (no errors or messages are generated). &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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Useful Snippets&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;
string InventoryName(string name, integer type)&lt;br /&gt;
{//finds an item in a case insensitive fashion of the given type and returns its true name.&lt;br /&gt;
    integer a = llGetInventoryType(name); &lt;br /&gt;
    if(!~a)//a == INVENTORY_NONE&lt;br /&gt;
    {//it should be noted that INVENTORY_NONE == INVENTORY_ALL == -1; which is why &amp;#039;!~a&amp;#039; works.&lt;br /&gt;
        string lc_name = llToLower(name);&lt;br /&gt;
        a = llGetInventoryNumber(type);&lt;br /&gt;
        while(a)&lt;br /&gt;
        {//(a = ~-a) is equivalent to --a, but runs faster.&lt;br /&gt;
            if(llToLower(name = llGetInventoryName(type, a = ~-a)) == lc_name)&lt;br /&gt;
            {//we found a match ^_^&lt;br /&gt;
                return name;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    else if((a == type) ^ (!~type))//return name, as long as a == type or type == INVENTORY_ALL&lt;br /&gt;
    {//we already know that a != INVENTORY_NONE, but just in case we use xor instead of or.&lt;br /&gt;
        return name;&lt;br /&gt;
    }&lt;br /&gt;
    return &amp;quot;&amp;quot;;//no match ~_~&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
integer InventoryExists(string name, integer type)&lt;br /&gt;
{//only included to show how this type of check could be done if the value of &amp;#039;type&amp;#039; is not constant and could be INVENTORY_ALL.&lt;br /&gt;
    return (llGetInventoryType(name) == type) ^ (!~type);&lt;br /&gt;
}//Since INVENTORY_ALL == INVENTORY_NONE, the extra part on the end is required to invert the result.&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;
•  	[[llGetInventoryNumber]] 	– 	Returns the number of items of a specific type in inventory 	 &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>