Difference between revisions of "Bot Playground/Commands/giveMoney"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Commands bot to send money (L$) to specific avatar.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.giveMoney(avatar, amou...")
 
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
{{API Variable|avatar|yes}} The avatar UUID.
 
{{API Variable|avatar|yes}} The avatar UUID.
 
{{API Variable|amount|yes}} The amount of money to give.
 
{{API Variable|amount|yes}} The amount of money to give.
{{API Variable|comment|}} (optional) Text comment for the money transaction.
+
{{API Variable|comment|(optional)}}Text comment for the money transaction.
 
{{API Variable Group|Output}}
 
{{API Variable Group|Output}}
 
{{API Return promise}}
 
{{API Return promise}}
Line 18: Line 18:
 
{{API Variables Table End}}
 
{{API Variables Table End}}
  
== Error messages ==
+
== Examples ==
  
Bot returns either ''result=OK'' on a successful transaction, or ''result=FAIL&resulttext=text-string'' to indicate the problem occurred (usually low bot's balance).
+
For a comprehensive balance management script check the [[Bot_Playground/Examples/Working_with_bot_money_balance|code in Examples section]].
 +
 
 +
== See also ==
 +
 
 +
* [[Bot_Playground/Commands/getBalance|getBalance()]]
 +
* [[Bot_Playground/Commands/giveInventory|giveInventory()]]
  
 
{{NavMenu}}
 
{{NavMenu}}
 
__NOTOC__
 
__NOTOC__

Latest revision as of 06:29, 2 November 2016

Commands bot to send money (L$) to specific avatar.

Bot.giveMoney(avatar, amount, comment);

Reference

This command accepts the following parameters:

Variable Required Description


giveMoney:
avatar yes The avatar UUID.
amount yes The amount of money to give.
comment (optional) Text comment for the money transaction.
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed

Examples

For a comprehensive balance management script check the code in Examples section.

See also