Difference between revisions of "HTTP API/Bot Commands/parcel info"
(5 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{API Variables Table}} | {{API Variables Table}} | ||
− | |||
− | |||
{{API Variable Group|Input}} | {{API Variable Group|Input}} | ||
Line 96: | Line 94: | ||
{{Generic table end}} | {{Generic table end}} | ||
− | === | + | === JSON response === |
Starting from Jan 2018 it is possible to get a JSON-formatted response from SmartBots API: | Starting from Jan 2018 it is possible to get a JSON-formatted response from SmartBots API: | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="javascript"> |
{ | { | ||
"action": "parcel_info", | "action": "parcel_info", |
Latest revision as of 09:28, 24 January 2018
Returns a lot of information about a parcel.
Variables
The following table shows input values (you send them with the API call) and returned output values.
Variable | Required | Description | ||
---|---|---|---|---|
Input: | ||||
x | optional | the X coordinate of the point in parcel | ||
y | optional | the Y coordinate of the point in parcel | ||
getvalue | optional | limit return list to this entry (see return values below) | ||
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. | |||
*** | A lot of variables, see below |
Comments
This API request returns a lot of information about a parcel. You can retrieve the information about:
- a parcel at a specific point (using x and y coordinates) or
- current bot's parcel (don't set x and y to fetch this info)
Return values
This request returns a lot of information about the parcel. The following entries are being returned:
Entry | Description |
---|---|
parcel_area | Parcel area, in m2 |
parcel_claimdate | The date when parcel was created/claimed |
parcel_description | Description of the parcel. IMPORTANT: the description is being URL-escaped (it can contain new-line characters). Use llUnescapeURL() function to decode. |
parcel_group | The UUID of the parcel group. |
parcel_groupowned | Contains True if parcel is group owned. |
parcel_groupprims | Total number of primitives owned by the parcel group on this parcel |
parcel_maxprims | Maximum number of primitives this parcel supports |
parcel_totalprims | Total number of primitives on this parcel |
parcel_musicurl | The music URL of the parcel |
parcel_cleantime | Auto-return time (minutes) |
parcel_owner | Parcel owner UUID |
parcel_ownerprims | The number of prims owned by the parcel owner (resident or group) |
parcel_saleprice | The price of the parcel (if parcel is for sale) |
parcel_snapshot | Key of parcel snapshot |
parcel_landingpoint | The landing point of the parcel |
parcel_flags | Various flags, separated by commas |
JSON response
Starting from Jan 2018 it is possible to get a JSON-formatted response from SmartBots API:
{
"action": "parcel_info",
"parcel_area": "10960",
"parcel_claimdate": "8/13/2011 11:49:01 AM",
"parcel_cleantime": "0",
"parcel_description": "SmartBots official office!\n\nGive a direct group invitation (by group inviter bots), scheduled notices and group IMs! Subscription is L$79/week.\n\nautomatic group inviter bot invite bots inviter rent bot for rent auto group export notice spam",
"parcel_flags": "AllowFly, AllowOtherScripts, AllowLandmark, ShowDirectory, AllowGroupScripts, CreateGroupObjects, AllowAPrimitiveEntry, AllowGroupObjectEntry, AllowVoiceChat, UseEstateVoiceChan",
"parcel_group": "20d1b192-8d6d-374d-fa65-efe607894550",
"parcel_groupowned": "False",
"parcel_groupprims": "46",
"parcel_landingpoint": "<201.613, 100.423, 32.2699>",
"parcel_maxprims": "3344",
"parcel_musicurl": "",
"parcel_name": "SmartBots: Second Life bots for L$79 / Inviter bot + notices",
"parcel_owner": "cd93067e-7c4e-41c0-ba91-be01f4bafe35",
"parcel_ownerprims": "2351",
"parcel_saleprice": "0",
"parcel_snapshot": "b60a21e4-58ec-4538-d705-c9b9666b05d9",
"parcel_totalprims": "2471",
"result": "OK"
}
Limiting the number of return values
parcel_info API request returns a lot of data which may be critical for LSL scripts. To limit return entries to specific one, use a getvalue parameter (see examples).
Examples
1. Get all information about parcel the bot is on:
action=parcel_info
2. Get the group UUID of the current bot's parcel:
action=parcel_info&getvalue=group
3. Get the number of owner's prims at point <25,32,0>:
action=parcel_info&getvalue=ownerprims&x=25&y=32
<< return back to Bot commands
(Miss an API call or parameter? Submit your request in forum)