logo bannerlogo banner
Page Navigator

The first and most important thing to do with your bot is to join a game. You should start by checking out the Joining Your First Game page, which will teach you how to join a game with your bot.

Once you've joined a game, there are many things you can do.

You should first understand the basic ways a Bot interacts with a game. The bot object has various properties and methods that allow you to interact with the game, like bot.game or bot.players.

Important

Anyone, new to advanced, should pay careful attention to the next few sections.

Dispatches

Dispatches are how we command the bot to do something. This can be anything from reloading the bot's gun to booting a player (assuming the bot is the game host).

Dispatches have an initial check run to make sure things like information passed are correct, the game mode is correct, etc. When you dispatch, it'll return a boolean value indicating whether the dispatch was valid:

const valid = bot.dispatch(new ChatDispatch('hi')); // returns true since "hi" is a valid chat message
const valid2 = bot.dispatch(new ChatDispatch('')); // returns false since you cannot send an empty chat message

Once the validation has passed, the dispatch is checked 30 times a second to see if it can be run. If it can, it is run. If it cannot, it is ignored and will be checked around 33ms later. This allows you to queue events, even if they can't technically be run yet. Dispatches are fully synchronous.

Click here for a full list of dispatches.

Hooks

Hooks are how we listen to events in the game. This can be anything from when a player joins the game to when a RPEGG rocket hits something.

bot.on('playerJoin', (player) => console.log(`${player.name} has joined the game!`));

Click here for a full list of dispatches.

Game Documentation

That's the basics - now here's all the stuff you can do!

  • Get Game Information - Learn how to get information about the game, such as coop/spatula information, map info, and more
  • Get Player Information - Learn how to get information about players in the game, such as their names, team, stats, position, and more
  • Chatting - Learn how to chat with players in the game and get incoming chat messages
  • Dispatches - Learn the various dispatches you can use to control the bot and interact with the game
  • Misc - Learn about miscellaneous utilities that can be useful in various ways, such as finding targets, quitting the game, and more