Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions botroyale/default_settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ default_map = "basic"
default_step_rate = 2
# Game speed options
toggle_step_rates = [1, 2, 3, 5, 60]
# Select these bots automatically (case sensitive)
auto_select_bots = [
# "basic",
]

[logging]
global = true
Expand Down
8 changes: 7 additions & 1 deletion botroyale/logic/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
from typing import Any, Union, Optional
from botroyale.gui import logger
from botroyale.util import settings
from botroyale.api.gui import GameAPI, InputWidget
from botroyale.api.bots import BOTS, BotSelection, NotFairError
from botroyale.logic.maps import MAPS, DEFAULT_MAP_NAME, get_map_state
Expand All @@ -12,6 +13,7 @@


BOT_SENDTO_PREFIX = "╠"
AUTO_SELECT_BOTS = settings.get("battle.auto_select_bots")


def _get_sorted_bots():
Expand All @@ -37,7 +39,11 @@ class StandardGameAPI(GameAPI):
def __init__(self, *args, **kwargs):
"""Initialize the class."""
super().__init__(*args, **kwargs)
self.selected_bots = []
self.selected_bots = [
BOTS[bot_name]
for bot_name in AUTO_SELECT_BOTS
if bot_name in BOTS
]
self.menu_values = dict(
editor=False,
map=DEFAULT_MAP_NAME,
Expand Down