From 644c2a106c607872fb537b90e5e47dfef1d766cf Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 20 May 2026 09:20:37 +0200 Subject: [PATCH] feat: auto-launch D2R on botty startup - main.py checks if D2R.exe is running, launches with auto-login if not - Set char_name=Burr in config for OCR character selection --- config/params.ini | 2 +- src/main.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/params.ini b/config/params.ini index c1be46a..430b2df 100644 --- a/config/params.ini +++ b/config/params.ini @@ -14,7 +14,7 @@ bnet_pass= ; Character name to auto-select from the character selection screen ; If empty, bot relies on the saved character template from previous sessions -char_name= +char_name=Burr ; messaging custom_loot_message_hook= diff --git a/src/main.py b/src/main.py index b0a7a85..571a463 100644 --- a/src/main.py +++ b/src/main.py @@ -87,6 +87,14 @@ def main(): print(f"ERROR: Unkown logg_lvl {Config().advanced_options['logg_lvl']}. Must be one of [info, debug]") startup_checks() + # Auto-launch D2R if not already running + from utils.restart import process_exists, restart_game + if not process_exists("D2R.exe"): + Logger.info("D2R is not running, launching...") + restart_game(Config().general["d2r_path"], Config().advanced_options["launch_options"]) + else: + Logger.info("D2R is already running") + print(f"============ Botty {__version__} [name: {Config().general['name']}] ============") print("\nFor gettings started and documentation\nplease read https://github.com/aeon0/botty\n") table = BeautifulTable()