OsGetLinkInventoryDesc

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
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">
// Beispiel für osGetLinkInventoryDesc
+
// Example for osGetLinkInventoryDesc
// In diesem Skript wird die Funktion osGetLinkInventoryDesc verwendet,
+
// This script uses the osGetLinkInventoryDesc function to get the description of a specified inventory item
// um die Beschreibung eines Gegenstands mit dem Namen oder der ID GEGENSTANDSNAME_ODER_ID aus dem Inventar der Unterprim mit der Nummer CHILD_PRIM_NUMBER abzurufen.
+
// It looks for the item via key or name in the specified linked prim
// Bitte beachten Sie,
+
// dass Sie den entsprechenden Wert für GEGENSTANDSNAME_ODER_ID durch den tatsächlichen Namen oder die ID des Gegenstands ersetzen müssen,
+
// dessen Beschreibung Sie abrufen möchten.
+
  
// Definiere die Nummer der Unterprim, die das Inventar enthält
+
// 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, der aufgerufen wird, wenn das Skript startet
+
// Event handler, that is executed on script start
 
default
 
default
 
{
 
{
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         // Speichere den Namen oder die ID des Gegenstands, dessen Beschreibung abgerufen werden soll
+
         // Get the description of the specified item from the linked prim
        string itemNameOrID = "GEGENSTANDSNAME_ODER_ID";
+
 
+
        // Führe die Funktion osGetLinkInventoryDesc aus, um die Beschreibung des Gegenstands abzurufen
+
 
         string itemDescription = osGetLinkInventoryDesc(CHILD_PRIM_NUMBER, itemNameOrID);
 
         string itemDescription = osGetLinkInventoryDesc(CHILD_PRIM_NUMBER, itemNameOrID);
  
         // Überprüfe, ob die Beschreibung nicht leer ist
+
         // Check if the description is not empty
 
         if (itemDescription != "")
 
         if (itemDescription != "")
 
         {
 
         {
             // Zeige die Beschreibung des Gegenstands im Besitzer-Chatfenster an
+
             // Output to owner chat channel
             llOwnerSay("Beschreibung des Gegenstands: " + itemDescription);
+
             llOwnerSay("Description reads: " + itemDescription);
 
         }
 
         }
 
         else
 
         else
 
         {
 
         {
             // Wenn die Beschreibung leer ist, zeige eine entsprechende Nachricht im Chat an
+
             // Notify if the description is empty or the item is missing entirely
             llOwnerSay("Der Gegenstand konnte nicht gefunden werden oder hat keine Beschreibung.");
+
             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


Personal tools
General
About This Wiki