autopilot_completed

From SmartBots Developers Docs
Bot PlaygroundEvents
Revision as of 10:23, 7 December 2023 by Gg (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Fires when bot autopilot successfully completes its journey. Not available for QubicBot yet (?)

Bot.on("autopilot_completed", 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.
endPoint Bot destination point, { X, Y, Z }
actualPoint Bot actual location, { X, Y, Z }

Example

console.log(`${process.name} started`);

Bot.on("autopilot_completed", (event) => {
	console.log(`Autopilot started: ${JSON.stringify(event, null, 2)}`);
});

/*
Autopilot completed: {
  "name": "autopilot_completed",
  "bot_slname": "DakotahRaine Resident",
  "bot_uuid": "4f6b8999-14a0-4f50-882d-a764ee913daa",
  "endPoint": {
    "X": 212,
    "Y": 25,
    "Z": 93
  },
  "actualPoint": {
    "X": 203.21446,
    "Y": 36.776222,
    "Z": 93.68485
  }
}
*/