31 July 2019

30 April 2027

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

CommandRequired ParametersRequired Corrade PermissionsExample
batchgivegroup, password, item, entityinventory
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).

ParameterPossible ValueAdditional ParametersDescriptionExample
entityavatarfirstnameThe first name of the avatar to give the item to.
lastnameThe second name of the avatar to give the item to.
agentThe key of the agent if more convenient than firstname and lastname
itemA CSV list of UUID or path to items in Corrade's inventory.
objectrangeThe 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)
        ]
    )
);
targetA name or UUID of the object to give the inventory item to.
itemA CSV list of UUID or path to items in Corrade's inventory.
selectionEither 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