Skip to content
lsl.devlsl.devLSL Dev

LlReturnObjectsByID

Looking for the current API? Open the llReturnObjectsByID reference →

Wiki description

If the script is owned by an agent, PERMISSION_RETURN_OBJECTS may be granted by the owner. If the script is owned by a group, this permission may be granted by an agent belonging to the group's "Owners" role.

Function notes

If the return value is negative, it represents an error flag.

Return value notes

Returns an integer that is the number of objects successfully returned to their owners or an ERR_* flag.

Specification

Script Owner and Scope

If the script is owned by an estate owner or manager, this function works for objects located on any parcel in the region. Otherwise, the script can return objects located over land owned by the owner of the script.
As a security measure, parcel owner, estate owner, and estate managers can not have their objects returned by this method, except when the object returns itself.

Throttle

Throttled at max parcel land impact capacity region-wide per hour.
ERR_GENERIC integer -1 m=3 c=A nebulous and inexplicable error, nothing is known about it.
ERR_PARCEL_PERMISSIONS integer -2 m=3 c=Permission lacked to perform task on specified parcel.
ERR_MALFORMED_PARAMS integer -3 m=3 c=Parameters are malformed.
ERR_RUNTIME_PERMISSIONS integer -4 m=3 c=Script lacks the runtime permission to perform the requested task.
ERR_THROTTLED integer -5 m=3 c=Task has been throttled. Try again later.
Error Flags Description

Caveats

  • Objects owned by other groups will be returned to their previous owner if the object is transferable, deleted otherwise.

Examples

key owner;

// list of objects to return
list objects_to_return = [
    "929f26d8-b225-5f6a-a26a-eeda27c31416",
    "f0abe779-1989-6be4-d73c-dcb48b4313cf",
    "bad9903-139f-2217-81f3-e61884540df6"
];

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS);
    }
    
    run_time_permissions(integer p)
    {
        if (p & PERMISSION_RETURN_OBJECTS)
        {
            llSetText("Touch me to return the list of objects defined in this script",<1,1,0>,1);
        }
    }

    touch_start(integer total_number)
    {
        if ((llGetPermissions() & PERMISSION_RETURN_OBJECTS) == 0)
        {
            llOwnerSay("Requesting permission to return objects.");
            llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS);
        }
        else
        {
            list found_objects = [];
            integer n = llGetListLength(objects_to_return);
            while(--n >= 0)
            {
                key object = llList2Key(objects_to_return, n);
                string pos = llList2String(llGetObjectDetails(object, [OBJECT_POS]), 0);
                if(pos == "" )
                {
                    llOwnerSay( "Object in return list " + (string)object + " not found - skipping.");
                }
                else
                {
                    llOwnerSay("Adding object " + (string)object + " at " + (string)pos + " to return list.");
                    found_objects += [object];
                }
            }
            llOwnerSay("Found " + (string)llGetListLength(found_objects) + " objects to return.");
            integer result = llReturnObjectsByID(found_objects);
            if(result >= 0)
            {
                llOwnerSay("Returned " + (string)result + " objects.");
            }
            else
            {
                llOwnerSay("llReturnObjectsByID returned error code " + (string)result
                    + " - see https://wiki.secondlife.com/wiki/LlReturnObjectsByID for meaning");
            }
        }
    }
}

See also: functions

History

Date of Release 18/06/2013

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:Issues/SVC-6281

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-6281|Shared group inventory|type=fs|fc=1}}

Template:LSL Function/permission

Original shared helper source (conditional wiki logic is not evaluated)
{{#if:

{{{{#if:{{#var:DEBUG_CHANNEL}}||:DEBUG_CHANNEL}}|}}

{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if:{{{1|<noinclude>*</noinclude>}}}|To run this function the script must request the [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} permission with [[llRequestPermissions]]{{#ifeq:{{{grant|anyone}}}|anyone||&#32;and it must be granted by {{{grant|anyone}}}}}.}}}}

{{#vardefine:caveats|{{#var:caveats}}{{#if:{{{1|<noinclude>*</noinclude>}}}|{{PBR}}
<div style="border: 1px dotted rgba(0,0,0,0.5);">{{Collapsible_Table/Simple|title=<h5 style="margin:0;">Permissions</h5>|table-style=width:100%;|autocollapse=*|content={{!}}<div>
* Do not depend upon the auto-grant status of permissions. '''Always''' use the [[run_time_permissions]] event.
* If the script lacks {{#if:{{{2|}}}|both the permissions [[{{{1}}}]] and [[{{{2}}}]]|the permission [[{{{1}}}]]}}, the script will shout an error on {{#var:DEBUG_CHANNEL}} and the operation fails (but the script continues to run).{{#ifeq:{{{grant|anyone<noinclude>*</noinclude>}}}|anyone||
* If [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} is granted by anyone other than {{{grant|anyone}}}, then when the function is called an error will be shouted on {{#var:DEBUG_CHANNEL}}.}}
{{{caveats|}}}{{LSL Function/permission/caveat switch|{{{1}}}}}{{#if:{{{2|}}}|{{LSL Function/permission/caveat switch|{{{2}}}}}}}</div>}}</div>}}}}

{{#vardefine:also_events|{{#var:also_events}}
{{LSL DefineRow||[[run_time_permissions]]|Permission receiving event}}}}
{{#vardefine:also_functions|{{#var:also_functions}}
{{LSL DefineRow||[[llGetPermissions]]|Get the permissions granted}}
{{LSL DefineRow||[[llGetPermissionsKey]]|Get the agent who granted permissions}}
{{LSL DefineRow||[[llRequestPermissions]]|Request permissions}}}}
{{#vardefine:also_articles|{{#var:also_articles}}
{{LSL DefineRow||[[:Category:LSL Permissions/Script|Script permissions]]|}}}}

<includeonly>{{#if:{{{nc|}}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||[[Category:LSL Requires Permissions]]}}
}}}}</includeonly>

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|header_footnote}}
|-
{{VarPair|caveats}}
|-
{{VarPairTable|also_events}}
|-
{{VarPairTable|also_functions}}
|-
{{VarPairTable|also_articles}}
|}
</noinclude>
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.