Difference between revisions of "HTTP API/Bot Commands/parcel buy"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE: parcel_buy}} <onlyinclude>Purchases the parcel at specific region point</onlyinclude> <syntaxhighlight lang="lsl"> // See "LSL Helper Functions" page for this...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE: parcel_buy}}
 
{{DISPLAYTITLE: parcel_buy}}
<onlyinclude>Purchases the parcel at specific region point</onlyinclude>
+
<onlyinclude>Purchases the parcel at specific point of the region</onlyinclude>
  
 
<syntaxhighlight lang="lsl">
 
<syntaxhighlight lang="lsl">
Line 12: Line 12:
 
{{API Variables Table}}
 
{{API Variables Table}}
  
{{API HTTP Required Vars|parcel_info_update}}
+
{{API HTTP Required Vars|parcel_buy}}
  
 
{{API Variable Group|Input}}
 
{{API Variable Group|Input}}
Line 27: Line 27:
 
== Permissions ==
 
== Permissions ==
  
# The land has to be set for sell (see [[./parcel_info_update parcel_info_update]] command to sell land)
+
# The land has to be set for sell (see [[HTTP_API/Bot_Commands/parcel_info_update|parcel_info_update]] command to sell land)
 
# The bot must have enough money on balance
 
# The bot must have enough money on balance
 
# If purchasing for the group, "Deed land and buy land for group" group ability is required
 
# If purchasing for the group, "Deed land and buy land for group" group ability is required
  
 
== Return values ==
 
== Return values ==
 
Use [https://www.mysmartbots.com/api/testing.html API testing suite] to test this API function.
 
  
 
The command returns  
 
The command returns  

Latest revision as of 16:59, 16 January 2020

Purchases the parcel at specific point of the region

// See "LSL Helper Functions" page for this function
smartbotsAPI("parcel_buy", [
  "x", 30,
  "y", 60
]);

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 = parcel_buy
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:
x optional the X coordinate of the parcel (default - at bot's position)
y optional the Y coordinate of the parcel (default - at bot's position)
group optional The UUID of the group to buy parcel for (if buying for the group)
remove_contribution optional 1 - remove the land contribution from the group after purchasing the parcel (if buying for the group)
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.

Permissions

  1. The land has to be set for sell (see parcel_info_update command to sell land)
  2. The bot must have enough money on balance
  3. If purchasing for the group, "Deed land and buy land for group" group ability is required

Return values

The command returns

result=OK

if parcel has been purchased.


<< return back to Bot commands

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