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

LSL Wiki : llGetInventoryName

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
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.

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
There are 2 comments on this page. [Display comments/form]