LlGetInventoryName/ja - Second Life Wiki

LlGetInventoryName/ja

From Second Life Wiki

Jump to: navigation, search

関数: string llGetInventoryName( integer type, integer number );

指定されたタイプのアイテムがプリムのインベントリに見つからなかった場合は、空のstringを返します。typenumber番目のインベントリアイテム名のstring値を返します。

• integer type INVENTORY_*フラグ
• integer number


numberマイナス域の番号はサポートしていません

フラグ インベントリタイプ
INVENTORY_NONE -1 アイテムは存在しません。
INVENTORY_ALL 何らかのインベントリタイプです。
INVENTORY_TEXTURE 0 texture
INVENTORY_SOUND 1 sound
INVENTORY_LANDMARK 3 landmark
INVENTORY_CLOTHING 5 clothing
フラグ インベントリタイプ
INVENTORY_OBJECT 6 object
INVENTORY_NOTECARD 7 notecard
INVENTORY_SCRIPT 10 script
INVENTORY_BODYPART 13 body part
INVENTORY_ANIMATION 20 animation
INVENTORY_GESTURE 21 gesture

Will Unpack all items of a box

 
// script created by SpiritWolf Chikuwa
// minor changes by Strife Onizuka to speed things up
//
// /!\ PUBLIC DOMAIN /!\
// You can Copy/Mod/Trans 
// Please, do not resell this script and give it full perm
// Just please leave this header intact
//
// Minor changes: (insert your name here and delete this comment if you do any mod of this script, thank you)
//
// Script start here:
 
list    gInventoryList;
 
list getInventoryList()
{
    list       result = [];
    integer    n = llGetInventoryNumber(INVENTORY_ALL);
    integer    i = 0;
 
    while(i < n)
    {
        result += llGetInventoryName(INVENTORY_ALL, i);
        ++i;
    }
    return result;
}
 
default
{
    state_entry()
    {
        gInventoryList = getInventoryList();
    }
 
    touch_start( integer n )
    {
        integer i = 0;
        string folder = llGetObjectName();
 
        while(i < n)
        {
            llGiveInventoryList(llDetectedKey(i), folder, gInventoryList );
            ++i;
        }
    }
 
    changed( integer change )
    {
       if ( change == CHANGED_INVENTORY )
           gInventoryList = getInventoryList();
    }
}
 
// llGetInventory number and name will scan all objects on the box.
// llGiveInventory will give you the content.
// See also llGetInventory and llGiveInventory on LSL Wiki for further informations.
 

関連項目

関数

•  llGetInventoryNumber インベントリ内の指定タイプのアイテム数を返します
•  llGetInventoryType インベントリアイテムが存在する場合は参照を試みて、その型を返します
•  llGetInventoryCreator インベントリアイテムの作者を返します
•  llGetInventoryPermMask インベントリアイテムの権限を返します
•  llGetInventoryKey インベントリアイテムのUUIDを返します(全権限がある場合)