find_objects

From SmartBots Developers Docs
Jump to: navigation, search

Returns the list of objects rezzed in the region.

// See "LSL Helper Functions" page for this function
smartbotsAPI("find_objects", []);

Variables

The following table shows input values (you send them with the API call) and returned output values.

Variable Required Description
Input basic parameters:
action yes = find_objects
apikey yes Your personal developer's API key.
botname yes Your bot's SL login.
secret yes Bot access code of your bot.
dataType optional Set to "json" to get JSON reply instead of URL-encoded string
custom optional The custom data (string) to be passed back to caller script. This value will be returned back to the caller in HTTP response.
Input:
uuid optional filter out a specific object with the uuid
in_search optional Looks for objects with the Properties "Show in search".
  • 0 (Default)
  • 1
current_parcel optional Looks for objects within the current parcel if 1 is sent.
  • 0
  • 1 (Default)
root_only optional Looks for objects root objects. It will not include linked object info.
  • 0
  • 1 (Default)
parent optional UUID. Show children objects of object UUID.
with_props optional Request additional object properties (Name, Description...).
  • 0
  • 1 (Default)
range optional The distance to scan in meters. (Default: All objects within bots sight)
limit optional Limit the amount of returned objects. (Default: 100) (Max: 100)
Output:
(to be received in http_response LSL event, see docs for details)
result OK - command completed successfully
FAIL - command failed
resulttext Detailed reason for the failure.
custom The value from input "custom" parameter. See above.
found The number of found objects (includes all objects outside the limit)
returned The number of found objects within the limit
objects An JSON-array of objects data. (UUID, Position, Distance..) See Example response below.

Example

Returns the bot's nearby objects:

(the example uses smartbotsAPI() helper function. Set your "apikey", "botname" and "secret" in that function)

smartbotsAPI("find_objects", ["limit", 2, "range", 20]);


Example

In the below example, I limited the amount of objects to 2 with a range of 20m.

The example of the objects list returned:

{
  "result": "OK",
  "action": "find_objects",
  "found": 30,
  "returned": 2,
  "objects": [
    {
      "UUID": "2e4c4962-0316-ecf4-ccf3-7c9db5b05bfc",
      "LocalID": 552702023,
      "Position": { 
        "X": 111.69685, 
        "Y": 234.43146, 
        "Z": 3003.1833 
      },
      "LocalPosition": { 
        "X": 111.69685, 
        "Y": 234.43146, 
        "Z": 3003.1833 
      },
      "ParcelLocalID": 7,
      "Distance": 3.2783988,
      "Flags": { 
        "InSearch": false 
      },
      "RootUUID": null,
      "Props": {
        "OwnershipCost": 10,
        "AggregatePermTextures": 21,
        "InventorySerial": 2,
        "TouchName": "",
        "Name": "NLS",
        "AggregatePerms": 53,
        "SitName": "",
        "AggregatePermTexturesOwner": 63,
        "LastOwnerID": "7351a3c1-009e-4a95-b737-413ad34ebed1",
        "FolderID": "00000000-0000-0000-0000-000000000000",
        "Permissions": {
          "NextOwnerMask": "Transfer, Move",
          "GroupMask": "None",
          "EveryoneMask": "None",
          "BaseMask": 2147483647,
          "OwnerMask": 2147483647
        },
        "GroupID": "a6ef452f-2043-7e65-360a-339a8d7927b8",
        "OwnerID": "7351a3c1-009e-4a95-b737-413ad34ebed1",
        "FromTaskID": "00000000-0000-0000-0000-000000000000",
        "Category": "None",
        "ObjectID": "2e4c4962-0316-ecf4-ccf3-7c9db5b05bfc",
        "ItemID": "00000000-0000-0000-0000-000000000000",
        "CreationDate": "2017-06-30T17:13:01",
        "Description": "",
        "TextureIDs": [
          "89556747-24cb-43ed-920b-47caed15465f",
          "89556747-24cb-43ed-920b-47caed15465f",
          "89556747-24cb-43ed-920b-47caed15465f",
          "89556747-24cb-43ed-920b-47caed15465f",
          "89556747-24cb-43ed-920b-47caed15465f",
          "89556747-24cb-43ed-920b-47caed15465f"
        ],
        "SaleType": "Not",
        "CreatorID": "7351a3c1-009e-4a95-b737-413ad34ebed1",
        "SalePrice": 10
      },
      "RootID": null,
      "Type": "Primitive",
      "ParentID": 0
    },
    {
      "ParentID": 0,
      "Distance": 3.2799234,
      "LocalID": 540403275,
      "Props": {
        "OwnerID": "7351a3c1-009e-4a95-b737-413ad34ebed1",
        "TouchName": "",
        "AggregatePermTexturesOwner": 0,
        "SitName": "",
        "TextureIDs": [
          "d23fc2ff-e870-5c53-9b4f-a993ad6516a1",
          "29b7f0bc-9e88-f618-4114-37fd462e7e09",
          "7a9035ca-8c0a-8004-2a07-41e55acce200",
          "a4a75637-7c68-01b5-8a57-d69170c383fa",
          "d088b04e-d6c5-2fc0-7db2-37b08a8ee994",
          "7f381ec0-2bc9-b017-7d8a-11b602109a87",
          "89735f1d-722f-21ba-3607-7b8cdd4047eb"
        ],
        "FromTaskID": "00000000-0000-0000-0000-000000000000",
        "Permissions": {
          "BaseMask": "Modify, Copy, Move",
          "NextOwnerMask": "Modify, Copy, Move",
          "EveryoneMask": "None",
          "GroupMask": "None",
          "OwnerMask": "Modify, Copy, Move"
        },
        "Description": "LandingLights,1337",
        "SaleType": "Not",
        "FolderID": "86822a18-11cb-94b2-0518-c8f4474e12ea",
        "CreatorID": "ea268e4d-29b8-40d1-8784-656c5fec2ea6",
        "AggregatePerms": 43,
        "AggregatePermTextures": 0,
        "ObjectID": "b23bedce-cc61-5828-4d56-2e08c7cf8b17",
        "GroupID": "a6ef452f-2043-7e65-360a-339a8d7927b8",
        "OwnershipCost": 10,
        "CreationDate": "1997-10-15T02:51:18",
        "InventorySerial": 3,
        "Name": "S2 Pro Switch - Industrial Large - ACCESS v1.2.0",
        "LastOwnerID": "ea268e4d-29b8-40d1-8784-656c5fec2ea6",
        "Category": "None",
        "ItemID": "a9afc493-f7f9-7c69-0291-b00b3c389db2",
        "SalePrice": 10
      },
      "Position": {
        "X": 117.94934,
        "Y": 235.63309,
        "Z": 3004.069
      },
      "Flags": {
        "InSearch": false
      },
      "RootUUID": null,
      "Type": "Primitive",
      "ParcelLocalID": 7,
      "RootID": null,
      "UUID": "b23bedce-cc61-5828-4d56-2e08c7cf8b17",
      "LocalPosition": {
        "X": 117.94934,
        "Y": 235.63309,
        "Z": 3004.069
      }
    }
  ]
}


<< return back to Bot commands

(Miss an API call or parameter? Submit your request in forum)