OsGetLinkInventoryDesc
From OpenSimulator
(Difference between revisions)
JeffKelley (Talk | contribs) m (added return type) |
|||
| (One intermediate revision by one user not shown) | |||
| Line 2: | Line 2: | ||
|threat_level=ignored | |threat_level=ignored | ||
|permissions=true | |permissions=true | ||
| − | |delay=0|function_syntax=osGetLinkInventoryDesc(integer linkNumber, string itemNameorid)<br> | + | |delay=0|function_syntax=string osGetLinkInventoryDesc(integer linkNumber, string itemNameorid)<br> |
|ossl_example=<source lang="lsl"> | |ossl_example=<source lang="lsl"> | ||
| − | // | + | // Example for osGetLinkInventoryDesc |
| − | // | + | // This script uses the osGetLinkInventoryDesc function to get the description of a specified inventory item |
| − | // | + | // It looks for the item via key or name in the specified linked prim |
| − | + | ||
| − | + | ||
| − | + | ||
| − | // | + | // Define the link number in which to look |
integer CHILD_PRIM_NUMBER = 2; | integer CHILD_PRIM_NUMBER = 2; | ||
| + | // Define the inventory name or key | ||
| + | string itemNameOrID = "INVENTORY_KEY_OR_NAME"; | ||
| − | // Event handler, | + | // Event handler, that is executed on script start |
default | default | ||
{ | { | ||
state_entry() | state_entry() | ||
{ | { | ||
| − | // | + | // Get the description of the specified item from the linked prim |
| − | + | ||
| − | + | ||
| − | + | ||
string itemDescription = osGetLinkInventoryDesc(CHILD_PRIM_NUMBER, itemNameOrID); | string itemDescription = osGetLinkInventoryDesc(CHILD_PRIM_NUMBER, itemNameOrID); | ||
| − | // | + | // Check if the description is not empty |
if (itemDescription != "") | if (itemDescription != "") | ||
{ | { | ||
| − | // | + | // Output to owner chat channel |
| − | llOwnerSay(" | + | llOwnerSay("Description reads: " + itemDescription); |
} | } | ||
else | else | ||
{ | { | ||
| − | // | + | // Notify if the description is empty or the item is missing entirely |
| − | llOwnerSay(" | + | llOwnerSay("Description empty or item not found"); |
} | } | ||
} | } | ||
Latest revision as of 22:38, 26 February 2024
string osGetLinkInventoryDesc(integer linkNumber, string itemNameorid)
| |
| Return the description of an item located in a child prim inventory. | |
| Threat Level | This function does not do a threat level check |
| Permissions | Use of this function is always allowed by default |
| Extra Delay | 0 seconds |
| Example(s) | |
// Example for osGetLinkInventoryDesc // This script uses the osGetLinkInventoryDesc function to get the description of a specified inventory item // It looks for the item via key or name in the specified linked prim // Define the link number in which to look integer CHILD_PRIM_NUMBER = 2; // Define the inventory name or key string itemNameOrID = "INVENTORY_KEY_OR_NAME"; // Event handler, that is executed on script start default { state_entry() { // Get the description of the specified item from the linked prim string itemDescription = osGetLinkInventoryDesc(CHILD_PRIM_NUMBER, itemNameOrID); // Check if the description is not empty if (itemDescription != "") { // Output to owner chat channel llOwnerSay("Description reads: " + itemDescription); } else { // Notify if the description is empty or the item is missing entirely llOwnerSay("Description empty or item not found"); } } } | |
| Notes | |
| This function was added in 0.9.3.0 | |