These are miscellaneous utilities that can be useful in various ways.
This function checks if the bot can see another player.
const canSee = bot.canSee(player);
console.log(`Can see player: ${canSee}`); // true or false
This closes the connection to the game, the matchmaker, and runs various cleanup functions.
Cleanup includes deleting nearly all properites on a bot, including bot.account, bot.game, and bot.players.
Once a bot has been quit, it cannot be used again. You must create a new bot to rejoin the game.
bot.quit();
See the CleanupLevel as a parameter to customize how much cleanup is done. By default, it uses CleanupLevel.Full.
If bot.quit is too much for you, and you want to be able to reuse a bot, you can use bot.leave() instead. This will leave the game, but keep the bot object intact so that you can rejoin games later.
bot.leave();
These are miscellaneous utilities that can be useful in various ways.
This function checks if the bot can see another player.
const canSee = bot.canSee(player);
console.log(`Can see player: ${canSee}`); // true or false
This closes the connection to the game, the matchmaker, and runs various cleanup functions.
Cleanup includes deleting nearly all properites on a bot, including bot.account, bot.game, and bot.players.
Once a bot has been quit, it cannot be used again. You must create a new bot to rejoin the game.
bot.quit();
See the CleanupLevel as a parameter to customize how much cleanup is done. By default, it uses CleanupLevel.Full.
If bot.quit is too much for you, and you want to be able to reuse a bot, you can use bot.leave() instead. This will leave the game, but keep the bot object intact so that you can rejoin games later.
bot.leave();