OsGetLinkInventoryName

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Translated comments)
Line 4: Line 4:
 
|delay=0|function_syntax=osGetLinkInventoryName(integer linkNumber, key itemId)<br>
 
|delay=0|function_syntax=osGetLinkInventoryName(integer linkNumber, key itemId)<br>
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
// Beispiel für osGetLinkInventoryName
+
// Example for osGetLinkInventoryName
// In diesem Skript wird die Funktion osGetLinkInventoryName verwendet,
+
// This script uses the osGetLinkInventoryName function to get the name of an inventory item via the key and child prim number
// um den Namen eines Gegenstands mit der UUID GEGENSTANDS_UUID aus dem Inventar der Unterprim mit der Nummer CHILD_PRIM_NUMBER abzurufen.
+
// Bitte beachten Sie, dass Sie den entsprechenden Wert für GEGENSTANDS_UUID durch die tatsächliche UUID des Gegenstands ersetzen müssen,
+
// dessen Namen Sie abrufen möchten.
+
  
// Definiere die Nummer der Unterprim, die das Inventar enthält
+
// Define the child prim
 
integer CHILD_PRIM_NUMBER = 2;
 
integer CHILD_PRIM_NUMBER = 2;
 +
// Define the key of the inventory item
 +
key itemUUID = "INVENTORY_ITEM_KEY";
  
// Event handler, der aufgerufen wird, wenn das Skript startet
+
// Event handler, that is executed on script start
 
default
 
default
 
{
 
{
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         // Speichere die UUID des Gegenstands, dessen Name abgerufen werden soll
+
         // Get the inventory item name via its key and the child prim number
        key itemUUID = "GEGENSTANDS_UUID";
+
 
+
        // Führe die Funktion osGetLinkInventoryName aus, um den Namen des Gegenstands abzurufen
+
 
         string itemName = osGetLinkInventoryName(CHILD_PRIM_NUMBER, itemUUID);
 
         string itemName = osGetLinkInventoryName(CHILD_PRIM_NUMBER, itemUUID);
  
         // Überprüfe, ob der Name nicht leer ist
+
         // Check if the name is not empty
 
         if (itemName != "")
 
         if (itemName != "")
 
         {
 
         {
             // Zeige den Namen des Gegenstands im Besitzer-Chatfenster an
+
             // Output the item name to owner chat
             llOwnerSay("Name des Gegenstands mit UUID " + (string)itemUUID + ": " + itemName);
+
             llOwnerSay("Name of the inventory item with UUID " + (string)itemUUID + ": " + itemName);
 
         }
 
         }
 
         else
 
         else
 
         {
 
         {
             // Wenn der Name leer ist, zeige eine entsprechende Nachricht im Chat an
+
             // If the name is empty or the item is not found indicate as such
             llOwnerSay("Der Gegenstand mit der UUID " + (string)itemUUID + " wurde nicht gefunden.");
+
             llOwnerSay("The inventory item with UUID " + (string)itemUUID + " may be empty or not found");
 
         }
 
         }
 
     }
 
     }

Revision as of 22:06, 26 February 2024

osGetLinkInventoryName(integer linkNumber, key itemId)
Return the name 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 osGetLinkInventoryName
// This script uses the osGetLinkInventoryName function to get the name of an inventory item via the key and child prim number
 
// Define the child prim
integer CHILD_PRIM_NUMBER = 2;
// Define the key of the inventory item
key itemUUID = "INVENTORY_ITEM_KEY";
 
// Event handler, that is executed on script start
default
{
    state_entry()
    {
        // Get the inventory item name via its key and the child prim number
        string itemName = osGetLinkInventoryName(CHILD_PRIM_NUMBER, itemUUID);
 
        // Check if the name is not empty
        if (itemName != "")
        {
            // Output the item name to owner chat
            llOwnerSay("Name of the inventory item with UUID " + (string)itemUUID + ": " + itemName);
        }
        else
        {
            // If the name is empty or the item is not found indicate as such
            llOwnerSay("The inventory item with UUID " + (string)itemUUID + " may be empty or not found");
        }
    }
}
Notes
This function was added in 0.9.3.0


Personal tools
General
About This Wiki