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.

Actions

Actions 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).

Actions have a 3-step lifecycle:

  • Validation
  • Checking
  • Execution

Validation is run when you initialize the action. This is where the action checks if the parameters passed are valid. For example, if you try to boot a player that doesn't exist, the validation will fail and the action will not be executed.

Checking is then run every 33ms to ensure that the action can be executed. For example, if you try to reload the bot's gun while it is already reloading, the check will fail and the action will not be executed.

Once checking passes, the action is immediately executed. Actions are fully synchronous.

Actions are run with bot.emit(name, ...params). For example, to send a chat message, you would do:

bot.emit('chat', 'Hello everyone!');

Click here for a full list of actions.

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 hooks.

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
  • Actions - Learn the various "actions" 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