Skip to content

Controlling the car

SWZ edited this page Mar 14, 2021 · 2 revisions

This code will drive the car forward. More details about the Controller object here

const { Client, Manager, Controller } = require("EasyRLBot");

class ExampleBot extends Client {
  constructor(...args) {
    super(...args); // Do not change this except if you know what you are doing.
  }
  getOutput(gameTickPacket, fieldInfo, ballPrediction) {
    let controller = new Controller(); // Create a new controller

    // Drive forward
    controller.throttle = 1;

    // Send controller to RLBot
    this.controller.sendInput(controller);
  }
}

let manager = new Manager(
  ExampleBot,
  3215 // This is the default port used by EasyRLBotExample
);
Clone this wiki locally