OsGetLinkInventoryKey

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Page creation)
 
m (Example added)
Line 7: Line 7:
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
//
 
//
// osGetLinkInventoryKey Script Exemple
+
// osGetLinkInventoryKey Script Example
 
//
 
//
 +
// This script runs in link #2
 +
// It will paint the prim with
 +
// a texture in root inventory
 +
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        string textureName = "K1100RS";
 +
        key textureUuid = osGetLinkInventoryKey (LINK_ROOT, textureName, INVENTORY_TEXTURE);
 +
        llOwnerSay ("Painting prim with texture "+textureUuid);
 +
        if (textureuuid != NULL_KEY)
 +
            llSetTexture (textureUuid, ALL_SIDES);
 +
    }
 +
}
 
</source>
 
</source>
 
|description=Returns id(key) of a inventory item <u>asset</u> within a prim inventory.<br> If name is not unique result maybe unpredictable.<br> This function extends llGetInventoryKey( string name ) to links.<br>Returns NULL_KEY if the item is not found or Owner has no rights
 
|description=Returns id(key) of a inventory item <u>asset</u> within a prim inventory.<br> If name is not unique result maybe unpredictable.<br> This function extends llGetInventoryKey( string name ) to links.<br>Returns NULL_KEY if the item is not found or Owner has no rights

Revision as of 07:54, 21 June 2024

key osGetLinkInventoryKey(integer linkNumber, string name)
Returns id(key) of a inventory item asset within a prim inventory.
If name is not unique result maybe unpredictable.
This function extends llGetInventoryKey( string name ) to links.
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)
//
// osGetLinkInventoryKey Script Example
//
// This script runs in link #2
// It will paint the prim with 
// a texture in root inventory
 
default
{
    state_entry()
    {
        string textureName = "K1100RS";
        key textureUuid = osGetLinkInventoryKey (LINK_ROOT, textureName, INVENTORY_TEXTURE);
        llOwnerSay ("Painting prim with texture "+textureUuid);
        if (textureuuid != NULL_KEY)
            llSetTexture (textureUuid, ALL_SIDES);
    }
}
Notes
osGetInventoryItemKey added in 0.9.1.0 Dev, Implemented August, 16 2019

osGetLinkInventoryKey added in 0.9.3.0 Dev, March 2024


See Also:

Personal tools
General
About This Wiki