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
This commit is contained in:
alex
2026-05-20 09:20:37 +02:00
parent 4b003bd95e
commit 644c2a106c
2 changed files with 9 additions and 1 deletions

View File

@@ -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=

View File

@@ -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()