<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
	<id>http://i.bnu.edu.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=LlGetInventoryNumber</id>
	<title>LlGetInventoryNumber - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://i.bnu.edu.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=LlGetInventoryNumber"/>
	<link rel="alternate" type="text/html" href="http://i.bnu.edu.cn/wiki/index.php?title=LlGetInventoryNumber&amp;action=history"/>
	<updated>2026-06-01T03:38:38Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://i.bnu.edu.cn/wiki/index.php?title=LlGetInventoryNumber&amp;diff=875&amp;oldid=prev</id>
		<title>Qmf：创建页面，内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function: integer llGetInventoryNumber( integer type ) |参数= 参…”</title>
		<link rel="alternate" type="text/html" href="http://i.bnu.edu.cn/wiki/index.php?title=LlGetInventoryNumber&amp;diff=875&amp;oldid=prev"/>
		<updated>2021-01-25T08:26:06Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function: integer llGetInventoryNumber( integer type ) |参数= 参…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{函数详情&lt;br /&gt;
|函数名 = Function: integer llGetInventoryNumber( integer type )&lt;br /&gt;
|参数= 参数：integer type–INVENTORY_* flag	&lt;br /&gt;
|返回值= 返回值：返回一个整数，表示prims库存中给定类型的项的数量。&lt;br /&gt;
&lt;br /&gt;
|注意事项=&lt;br /&gt;
注意事项&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|示例=&lt;br /&gt;
&amp;lt;pre&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'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; //minus 1, the script itself isn't counted, since its used with the INVENTORY_ALL flag&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;
objects = llGetInventoryNumber(INVENTORY_OBJECT);&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;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|相关函数=	&lt;br /&gt;
[[llGetInventoryName]] -返回库存项的名称&lt;br /&gt;
[[llGetInventoryType]] -测试库存项是否存在并返回其类型&lt;br /&gt;
[[llGetInventoryCreator]] -返回库存物品的创建者&lt;br /&gt;
[[llGetInventoryPermmask]] -返回库存项的权限&lt;br /&gt;
[[llGetInventoryKey]] -返回库存项的UUID(如果是完整的perm)&lt;br /&gt;
&lt;br /&gt;
|相关事件=&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Qmf</name></author>
		
	</entry>
</feed>