Difference between revisions of "LlGetInventoryDesc"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|issues={{Issue/V1|SCR-11|type=fs|string llGetInventoryDesc(string name)}}
|inject-2={{LSL_Function/inventory|item|uuid=false}}
|func_id
|func_id=0|func_sleep=0.0|func_energy=10.0
|mode=request
|func_sleep=0.0
|func_energy=10.0
|func=llGetInventoryDesc
|func=llGetInventoryDesc
|return_type=string
|return_type=key
|p1_type=string|p1_name=name|p1_desc=name of an inventory item
|p1_type=string|p1_name=item
|func_footnote=If the item does not exist, [[EOF]] is returned (no errors or messages are generated).
|sort=GetInventoryDesc
|func_footnote
|func_desc
|func_desc
|return_text=that is the description of the inventory item '''name'''.
|return_text=with the description of the inventory {{LSLP|item}}.
|spec
|spec
|caveats
|caveats=
|examples
* If {{LSLP|item}} has no description an empty string is returned.
|constants
|examples=Add an object to a prims inventory, as well as this script, in order to get the name of the creator.
<source lang="lsl2">default
{
    touch_start(integer total_number)
    {
        integer count = llGetInventoryNumber(INVENTORY_ALL);
        integer index;
        for (index = 0; index < count; ++index)
        {
            string name = llGetInventoryName(INVENTORY_ALL, index);
            string desc = llGetInventoryDesc(name);
           
            llSay(0, "Item: \"" + name + "\" -- \"" + desc + "\"");
        }
    }
}
</source>
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetInventoryAcquireTime]]|Returns the time the item was added to the prim's inventory}}
{{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}}
{{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}}
{{LSL DefineRow||[[llGetInventoryType]]|Tests to see if an inventory item exists and returns its type}}
{{LSL DefineRow||[[llGetInventoryNumber]]|Returns the number of items of a specific type in inventory}}
{{LSL DefineRow||[[llGetInventoryNumber]]|Returns the number of items of a specific type in inventory}}
{{LSL DefineRow||[[llGetInventoryType]]|Tests to see if an inventory item exists and returns it's type.}}
{{LSL DefineRow||[[llGetInventoryCreator]]|Returns the inventory item's creator}}
{{LSL DefineRow||[[llGetInventoryPermMask]]|Returns the inventory item's permissions}}
{{LSL DefineRow||[[llGetInventoryPermMask]]|Returns the inventory item's permissions}}
{{LSL DefineRow||[[llGetInventoryKey]]|Returns the inventory item's [[UUID]] (if full perm)}}
{{LSL DefineRow||[[llGetInventoryKey]]|Returns the inventory item's [[UUID]] (if full perm)}}
Line 25: Line 41:
|also_tests
|also_tests
|also_articles
|also_articles
|notes=
|notes
Very useful for recognizing versions and features of Inventory.
|cat1=Inventory
|permission
|sort=GetInventoryDesc
|cat1
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 14:13, 29 August 2023

Summary

Function: key llGetInventoryDesc( string item );

Returns a key with the description of the inventory item.

• string item an item in the inventory of the prim this script is in

Caveats

  • If item is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
  • If item has no description an empty string is returned.
All Issues ~ Search JIRA for related Bugs

Examples

Add an object to a prims inventory, as well as this script, in order to get the name of the creator.

default
{
    touch_start(integer total_number)
    {
        integer count = llGetInventoryNumber(INVENTORY_ALL);
        integer index;
        for (index = 0; index < count; ++index)
        {
            string name = llGetInventoryName(INVENTORY_ALL, index);
            string desc = llGetInventoryDesc(name);
            
            llSay(0, "Item: \"" + name + "\" -- \"" + desc + "\"");
        }
    }
}

See Also

Functions

•  llGetInventoryAcquireTime Returns the time the item was added to the prim's inventory
•  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
•  llGetInventoryKey Returns the inventory item's UUID (if full perm)

Deep Notes

Search JIRA for related Issues

Signature

function key llGetInventoryDesc( string item );