Table of Contents

Get Inventory Path

15 December 2023

  • C12 - added the regular expression option.

22 March 2021

  • C11 - added the type parameter and the ability to retrieve the full path of an inventory item both by inventory UUID and by searching using regular expressions.

7 December 2021

  • C11 - added the path parameter.

6 January 2015

  • Release 7.40 - added.
getinventorypath (Commands)
TypeCorrade progressive command
Commandgetinventorypath
DescriptionThe getinventorypath command can be used to retrieve full path names for inventory items by searching for a criteria.
Permissionsinventory
Parametersgroup, password, type
Last ChangesC11 - added the type parameter and the ability to retrieve the full path of an inventory item both by inventory UUID and by searching using regular expressions.

The getinventorypath command can be used to retrieve full path names for inventory items by searching for a criteria.

Command Required Parameters Required Corrade Permissions Example
getinventorypath group, password, type inventory
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve the inventory path of an inventory item
            // referenced by the inventory UUID 95553c51-8285-af6a-ed91-9ac30cf85c79
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "UUID",
            "UUID", "95553c51-8285-af6a-ed91-9ac30cf85c79",
            "callback", wasURLEscape(URL)
        ]
    )
);
Parameter Sub-Parameter Optional Parameter Possible Value Description
type UUID an inventory UUID Retrieve the full inventory path for an inventory item referenced by its inventory UUID.
pattern path a regular expression Search the inventory whilst matching inventory items by the regular expression specified by pattern, optionally just inside the folder given by path, and return the full paths to the found items.
options A CSV list of regular expression engine options.

Examples

The command can search both by inventory UUID and by regular expression. When searching by inventory UUID, for example:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "UUID",
            "UUID", "95553c51-8285-af6a-ed91-9ac30cf85c79",
            "callback", wasURLEscape(URL)        
        ]
    )
);

the result will be a list with one single element if the inventory item exists and could be located or a false success status accompanied with an error message.

When searching the inventory using a regular expression, for example:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "pattern",
            "options", wasListToCSV(["IgnoreCase"]),
            "pattern", wasURLEscape("Crystal[0-9]+"),
            "callback", wasURLEscape(URL)        ]
    )
);

then the paths of all items matching the regular expression Crystal[0-9]+ will be returned to the callback.

Notes

  • Note that when the type is set to UUID, the UUID parameter takes as value an inventory UUID.
  • This command will take a relatively long time depending on the size of the inventory since every item has to be fetched and then matched against the regular expression. Subsequent searches should be faster since the inventory will have been cached during the first search.
    • The search can be sped up considerably by passing the path parameter in case the folder in which the searched item resides is known before executing the command.

secondlife/scripted_agents/corrade/api/commands/getinventorypath.txt ยท Last modified: 2023/12/16 18:27 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.