listInventory

From SmartBots Developers Docs
Jump to: navigation, search

Returns a list of the Second Life groups the bot is member of.

Bot.listGroups(folderUUID).then(function(result) { ... });

Reference

This command accepts the following parameters:

Variable Required Description


Input:
uuid yes The UUID of the folder. Leave blank for root folder contents.
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed
list Array An array containing selected folder items. Each array item is:
{
 type: item type (see below),
 name: inventory item name,
 inventoryUUID: the UUID of the inventory item,
 assetUUID: this asset UUID (unique id of the object in SL, see below),
 flags: WORN - item is being worn,
 permissions: permission object (see below),
 nextPermissions: next owner permissions, similar to above
}

Item type:
a string which shows what kind of item is it: "folder", "object", "notecard", "clothing" etc.

Permissions object format:

{
 mod: true/false,
 copy: true/false,
 transfer: true/false
}

Comments

Useful folders

If you need to know what your bot is currently wearing, find the "Current Outfit" folder in a root of the inventory.

Inventory-ID vs Asset-ID

There's a huge difference between "inventory ID" and "asset ID":

  • "Inventory ID" is an id of the object in avatar's personal inventory.
  • "Asset ID" is a global id of the item within SL database ("asset server").

Therefore, you may have two identical textures in the bots inventory: they will have a different Inventory-ID but the same Asset-ID (because they point to the same image on the SL server).

So, the rules are:

  • When you rez an item from inventory, you need to pick up an object by Inventory-ID. You rez specific object.
  • When the script sets a texture to a face, it uses Asset-ID (because scripts have no access to your inventory! It just tells SL to fetch a specific image from the global database)

Examples

See the Currently worn items scripts in our Playground Examples section.