OsGetLinkInventoryKey
From OpenSimulator
(Difference between revisions)
JeffKelley (Talk | contribs) (Page creation) |
JeffKelley (Talk | contribs) m (Edited example comment) |
||
| (2 intermediate revisions by one user not shown) | |||
| Line 7: | Line 7: | ||
|ossl_example=<source lang="lsl"> | |ossl_example=<source lang="lsl"> | ||
// | // | ||
| − | // osGetLinkInventoryKey Script | + | // osGetLinkInventoryKey Script Example |
// | // | ||
| + | // This script runs in a child prim | ||
| + | // 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 | ||
Latest revision as of 02:01, 22 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 a child prim // 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: