Difference between revisions of "Bot Playground/Commands/fly"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Starts or stops flying.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.fly(isFlying); </syntaxhighlight> {{API Command T...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
− | Bot.fly( | + | Bot.fly(enableFlying); |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 10: | Line 10: | ||
{{API Variable Group|Input}} | {{API Variable Group|Input}} | ||
− | {{API Variable| | + | {{API Variable|enableFlying|yes}} boolean, true to start flying, false to stom |
{{API Variable Group|Output}} | {{API Variable Group|Output}} | ||
Line 21: | Line 21: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
+ | // Bots Playground script: [TEST] Fly (build 1 by Glaznah Gassner) | ||
Bot.fly(true); | Bot.fly(true); | ||
+ | |||
+ | // Wait a bit and stop flying | ||
+ | await process.sleep(5_000); | ||
+ | |||
+ | Bot.fly(false); | ||
+ | |||
+ | // Gracefully exit the test script | ||
+ | process.exit(); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 10:55, 7 December 2023
Starts or stops flying.
Bot.fly(enableFlying);
Reference
This command accepts the following parameters:
Variable | Required | Description
| |
---|---|---|---|
Input: | |||
enableFlying | yes | boolean, true to start flying, false to stom | |
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
// Bots Playground script: [TEST] Fly (build 1 by Glaznah Gassner)
Bot.fly(true);
// Wait a bit and stop flying
await process.sleep(5_000);
Bot.fly(false);
// Gracefully exit the test script
process.exit();