Difference between revisions of "LlGetInventoryKey"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
(+ |caveats=*Function does not work for scripts or objects. See {{Jira|SVC-3670}}.) |
|||
Line 10: | Line 10: | ||
|caveats=*Function does not work for scripts or objects. See {{Jira|SVC-3670}}. | |caveats=*Function does not work for scripts or objects. See {{Jira|SVC-3670}}. | ||
|constants | |constants | ||
|examples | |examples=<lsl>string notecard_name = "Default"; | ||
default | |||
{ | |||
state_entry() | |||
{ | |||
llOwnerSay("Touch to get the key for \"" + notecard_name + "\"."); | |||
} | |||
touch_start(integer total_number) | |||
{ | |||
key notecard_key = llGetInventoryKey(notecard_name); | |||
if(notecard_key != NULL_KEY) | |||
{ | |||
llOwnerSay("The key for \"" + notecard_name + "\" is \"" + (string)notecard_key + "\""); | |||
} | |||
else | |||
{ | |||
llOwnerSay("Notecard not found."); | |||
} | |||
} | |||
} | |||
</lsl> | |||
|helpers | |helpers | ||
|also_functions= | |also_functions= |
Revision as of 06:48, 16 February 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: key llGetInventoryKey( string name );175 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a key that is the UUID of the inventory name
• string | name | – | an item in the inventory of the prim this script is in |
If item is not copy, mod, trans then the return is NULL_KEY
Caveats
- If name is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
- Function does not work for scripts or objects. See SVC-3670.
Examples
<lsl>string notecard_name = "Default";
default {
state_entry() { llOwnerSay("Touch to get the key for \"" + notecard_name + "\"."); }
touch_start(integer total_number) { key notecard_key = llGetInventoryKey(notecard_name); if(notecard_key != NULL_KEY) { llOwnerSay("The key for \"" + notecard_name + "\" is \"" + (string)notecard_key + "\""); } else { llOwnerSay("Notecard not found."); } }
}
</lsl>See Also
Functions
• | llGetInventoryName | – | Returns the inventory item's name | |
• | llGetInventoryType | – | Tests to see if an inventory item exists and returns its type | |
• | llGetInventoryNumber | – | Returns the number of items of a specific type in inventory | |
• | llGetInventoryPermMask | – | Returns the inventory item's permissions | |
• | llGetInventoryCreator | – | Returns the inventory item's creator |