Batch Give Inventory Items

31 July 2019

  • C10 - added the selection optional parameter.

30 April 2027

  • Release 9.163 - added.
batchgive (Commands)
TypeCorrade progressive command
Commandbatchgive
DescriptionThe batchgive command can be used to send multiple items from Corrade's inventory to an agent or object.
Permissionsinventory
Parametersgroup, password, item, entity
Last ChangesRelease 9.163 - added.

The batchgive command can be used to give multiple items from inventory to an agent or object.

Command Required Parameters Required Corrade Permissions Example
batchgive group, password, item, entity inventory
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "batchgive",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "avatar",
            // send three items
            "item", wasListToCSV(
                [
                    // an inventory item by path
                    wasURLEscape("/My Inventory/Objects/Carrot"),
                    wasURLEscape("/My Inventory/Objects/Rabbit"),
                    // an inventory item's UUID
                    "8fa764dd-56cd-4de7-bc06-f0af3b890d9c"
                ]
            ),
            // or "agent", "69ce412b-dffc-436d-86ff-d788bfa66d9d"
            "firstname", "Bugs",
            "lastname", "Bunny"
        ]
    )
);

item is a CSV list of inventory paths or inventory item UUIDs (please note that inventory item UUIDs are different from asset UUIDs and also different from in-world object UUIDs - you need to specify an inventory UUID, not the latter).

Parameter Possible Value Additional Parameters Description Example
entity avatar firstname The first name of the avatar to give the item to.
lastname The second name of the avatar to give the item to.
agent The key of the agent if more convenient than firstname and lastname
item A CSV list of UUID or path to items in Corrade's inventory.
object range The range in which to find the object to give the item to.
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "batchgive",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // list of items to give.
            "item", wasListToCSV(
                [
                    wasURLEscape("/My Inventory/Gestures/smile"),
                    wasURLEscape("/My Inventory/Textures/me")
                ]
            ),
            // give the item to an object
            // instead of an avatar.
            "entity", "object",
            // object name or uuid to give
            // the item to.
            "target", "Face",
            // the range in which to find
            // the object to give the item to.
            "range", 3,
            "callback", wasURLEscape(URL)
        ]
    )
);
target A name or UUID of the object to give the inventory item to.
item A CSV list of UUID or path to items in Corrade's inventory.
selection Either attached, rezzed or all for selecting only primitives or objects attached to avatars, primitives or objects rezzed in-world or all primitives or objects respectively.

The permissions on the item can be set by passing a permissions key with the permissions set in Corrade permission notation. For example, to change the next-owner permissions to only copy when sending items, you would issue:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "batchgive",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "avatar",
            "item", wasListToCSV(
                [
                    wasURLEscape("/My Inventory/Objects/Carrot"),
                    wasURLEscape("/My Inventory/Objects/Bunny")
                ]
            ),
            // or "agent", "69ce412b-dffc-436d-86ff-d788bfa66d9d"
            "firstname", "Bugs",
            "lastname", "Bunny",
            // set permissions to copy only
            "permissions", "c--mvt------------c---v-c--mvt"
        ]
    )
);

Notes