Difference between revisions of "Bot Playground/Events/autopilot started"
From SmartBots Developers Docs
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
Bot.on("autopilot_started", function(event) { ... }); | Bot.on("autopilot_started", function(event) { ... }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | See [[Bot Playground/Commands/walkTo|Bot.walkTo()]] command for autopilot usage. | ||
{{API Event Table}} | {{API Event Table}} | ||
{{API Variable Group|''event'' object properties}} | {{API Variable Group|''event'' object properties}} | ||
− | {{API Variable|name}}The name of the event | + | {{API Variable|name}}The name of the event |
{{API Variable|bot_name}}The name of the bot teleporting. | {{API Variable|bot_name}}The name of the bot teleporting. | ||
{{API Variable|currentPoint}}Bot current location, { X, Y, Z } | {{API Variable|currentPoint}}Bot current location, { X, Y, Z } | ||
Line 21: | Line 23: | ||
Bot.on("autopilot_started", (event) => { | Bot.on("autopilot_started", (event) => { | ||
− | console.log(`Autopilot started: ${JSON.stringify(event)}`); | + | console.log(`Autopilot started: ${JSON.stringify(event, null, 2)}`); |
}); | }); | ||
− | |||
/* | /* | ||
− | Autopilot started: {"name":"autopilot_started","bot_slname":"DakotahRaine Resident","bot_uuid":"4f6b8999-14a0-4f50-882d-a764ee913daa","endPoint":{"X": | + | Autopilot started: { |
+ | "name": "autopilot_started", | ||
+ | "bot_slname": "DakotahRaine Resident", | ||
+ | "bot_uuid": "4f6b8999-14a0-4f50-882d-a764ee913daa", | ||
+ | "endPoint": { | ||
+ | "X": 212, | ||
+ | "Y": 25, | ||
+ | "Z": 93 | ||
+ | }, | ||
+ | "currentPoint": { | ||
+ | "X": 203.21446, | ||
+ | "Y": 36.776222, | ||
+ | "Z": 93.68485 | ||
+ | } | ||
+ | } | ||
*/ | */ | ||
Latest revision as of 10:23, 7 December 2023
Fires when bot autopilot starts. Not available for QubicBot yet (?)
Bot.on("autopilot_started", function(event) { ... });
See Bot.walkTo() command for autopilot usage.
Reference
This event comes with the following event object:
Variable | Required | Description | |
---|---|---|---|
event object properties: | |||
name | The name of the event | ||
bot_name | The name of the bot teleporting. | ||
currentPoint | Bot current location, { X, Y, Z } | ||
endPoint | Bot destination point, { X, Y, Z } |
Example
console.log(`${process.name} started`);
Bot.on("autopilot_started", (event) => {
console.log(`Autopilot started: ${JSON.stringify(event, null, 2)}`);
});
/*
Autopilot started: {
"name": "autopilot_started",
"bot_slname": "DakotahRaine Resident",
"bot_uuid": "4f6b8999-14a0-4f50-882d-a764ee913daa",
"endPoint": {
"X": 212,
"Y": 25,
"Z": 93
},
"currentPoint": {
"X": 203.21446,
"Y": 36.776222,
"Z": 93.68485
}
}
*/