OsGetInventoryItemKey

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Add Author)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=ignored
 
|threat_level=ignored
|permissions=true
+
|permissions=Script owner needs modify, copy and transfer rights
 
|delay=0
 
|delay=0
 
|function_syntax=key osGetInventoryItemKey(string name)
 
|function_syntax=key osGetInventoryItemKey(string name)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 +
//
 +
// osGetInventoryItemKey Script Exemple
 +
// Author: Ubit
 +
//
 +
 
default
 
default
 
{
 
{
 +
    state_entry()
 +
    {
 +
        llSay(PUBLIC_CHANNEL, "Touch me to see osGetInventoryItemKey usage.");
 +
    }
  
 
+
    touch_start(integer number)
 +
    {
 +
        key ItemKey = osGetInventoryItemKey("MyItemName");
 +
        if (ItemKey != NULL_KEY)llSay(PUBLIC_CHANNEL, "Item key is " + osGetInventoryDesc(ItemKey));
 +
        else llSay(PUBLIC_CHANNEL, "The item key is a NULL_KEY, item not found or owner has no rights ...");
 +
    }
 
}
 
}
 
</source>
 
</source>
|description=Returns id(key) of a inventory item within the prim inventory.<br> If name is not unique result maybe unpredictable.<br> Note that unlike this function, llGetInventoryKey does not return the item ID but the ID of its asset<br> Script owner needs modify rights.
+
|description=Returns id(key) of a inventory item within the prim inventory.<br> If name is not unique result maybe unpredictable.<br> Note that unlike this function, llGetInventoryKey does not return the item ID but the ID of its asset.<br>Returns NULL_KEY if the item is not found or Owner has no rights
 
|additional_info=This function was added in 0.9.1.0 Dev
 
|additional_info=This function was added in 0.9.1.0 Dev
 
Implemented August, 16 2019
 
Implemented August, 16 2019
 
}}
 
}}
 +
'''See Also:'''
 +
* [[osGetInventoryName]]
 +
* [[osGetInventoryDesc]]
 +
* [[osGetInventoryItemKey]]
 +
* [[osGetInventoryLastOwner]]
 +
* [[osGetLastChangedEventKey]]

Latest revision as of 11:18, 2 December 2020

key osGetInventoryItemKey(string name)
Returns id(key) of a inventory item within the prim inventory.
If name is not unique result maybe unpredictable.
Note that unlike this function, llGetInventoryKey does not return the item ID but the ID of its asset.
Returns NULL_KEY if the item is not found or Owner has no rights
Threat Level This function does not do a threat level check
Permissions Script owner needs modify, copy and transfer rights
Extra Delay 0 seconds
Example(s)
//
// osGetInventoryItemKey Script Exemple
// Author: Ubit
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch me to see osGetInventoryItemKey usage.");
    }
 
    touch_start(integer number)
    {
        key ItemKey = osGetInventoryItemKey("MyItemName");
        if (ItemKey != NULL_KEY)llSay(PUBLIC_CHANNEL, "Item key is " + osGetInventoryDesc(ItemKey));
        else llSay(PUBLIC_CHANNEL, "The item key is a NULL_KEY, item not found or owner has no rights ...");
    }
}
Notes
This function was added in 0.9.1.0 Dev

Implemented August, 16 2019


See Also:

Personal tools
General
About This Wiki