Don't click here unless you want to be banned.

LSL Wiki : llGetInventoryName

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl809.us.archive.org
string llGetInventoryName(integer type, integer number)

Gets the name of the inventory item number of type. Items are numbered starting from zero. If no item of the specified type is found an empty string is returned.

Note: The inventory is returned in alphabetical order.

Use the following constants to specify type:
Constant Value Look At Hex
INVENTORY_ALL -1 all inventory items
INVENTORY_ANIMATION 20 animations 0x14
INVENTORY_BODYPART 13 body parts 0x0D
INVENTORY_CLOTHING 5 clothing 0x05
INVENTORY_GESTURE 21 gestures 0x15
INVENTORY_LANDMARK 3 landmarks 0x03
INVENTORY_NOTECARD 7 notecards 0x07
INVENTORY_OBJECT 6 objects 0x06
INVENTORY_SCRIPT 10 scripts 0x0A
INVENTORY_SOUND 1 sounds 0x01
INVENTORY_TEXTURE 0 textures 0x00

Note: Inventory constants are not bitflags and thus should not be used with Bitwise operators.

Example:
llSay(0, "I have a notecard named " + llGetInventoryName(INVENTORY_NOTECARD, 0) + " in my contents.");
//
//put here for firefox- it was collapsing the window
//

Q: Is there a way to directly check if an item exists in inventory without having to run a for loop?
A: Yes, you can use llGetInventoryType. All inventory functions are case sensative.

Compare with llGetInventoryKey and llGetInventoryNumber.

To get the name of the current script, use llGetScriptName.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Inventory
Comments [Hide comments/form]
Sorted the table alphebetically instead of by value.
-- CrossLament (2006-04-29 14:48:56)
1) Is it certain that the Inventory items are numbered in the order in which they are put in the Inventory?
2) How to get the owner of the item that has been placed in the Inventory (for example if the permission has been granted to drop an item in the Inventory)?
-- HeusDens (2007-07-29 15:54:41)
Attach a comment to this page: