LlGiveInventoryList

From Second Life Wiki

Jump to: navigation, search

Contents

Summary

Function: llGiveInventoryList( key target, string folder, list inventory );
231 Function ID
3.0 Delay
10.0 Energy

Gives inventory items to target, creating a new folder to put them in.

• key target avatar or prim UUID that is in the same region
• string folder folder name to use
• list inventory a list of items in the prim's inventory

Specification

target types

Depending upon the type of target this function works differently.

  • Avatar
    • Must be or recently have been within the same Region as sending object. SVC-868
    • Places the inventory items in a newly created folder in the avatars inventory (even if there is a folder by the same name, a new one is created).
  • Prim / Object
    • The prim must be in the same region.
    • Does not create a folder.

Caveats

  • This function causes the script to sleep for 3.0 seconds.
  • If target is is not the owner nor shares the same owner, and inventory cannot be transferred, an error is shouted on DEBUG_CHANNEL.
  • If inventory cannot be copied then an error is shouted on DEBUG_CHANNEL.
  • If target is a prim that is not in the same region an error is shouted on DEBUG_CHANNEL.
  • If inventory is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
  • Group deeded objects cannot use this function, the error "Group owned objects cannot give inventory." is shouted on DEBUG_CHANNEL.

Search JIRA for related Bugs

Examples

// When any user clicks this object, this script will give a folder containing everything in the objects inventory
// This could be used to give away multiple freebies at once.
 
default
{
    touch_start(integer total_number)
    {
        list        inventory;
        integer     num = llGetInventoryNumber(INVENTORY_ALL);
        string      script = llGetScriptName();
        integer     i = 0;
 
        for (; i < num; ++i) {
            string name = llGetInventoryName(INVENTORY_ALL, i);
            //Don't give them the selling script.
            if(name != script)
            {
                if(llGetInventoryPermMask(name, MASK_OWNER) & PERM_COPY)
                {
                    inventory += name;
                }
                else
                {
                    llSay(0, "Don't have permissions to give you \""+name+"\".");
                }
            }
        }
 
        if (llGetListLength(inventory) < 1)
        {
            llSay(0, "No items to offer."); 
        }
        else
        {
            // give folder to agent, use name of object as name of folder we are giving
            llGiveInventoryList(llDetectedKey(0), llGetObjectName(), inventory);
        }
    }
}

See Also

Events

•  changed

Functions

•  llGiveInventory

Deep Notes

Issues

~ Search JIRA for related Issues
New Feature - A new feature of the product, which has yet to be developed. Open - The issue is open and ready for the assignee to start work on it.    llGiveInventoryList should be able to work gridwide
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.
Personal tools
In other languages