Entry Point
The bot is executed through the main entry point insrc/__main__.py:
Main Function
Themain() function accepts optional command-line arguments to control execution mode:
Command-Line Interface
The bot supports three execution modes via command-line arguments:Execution Modes
The execution mode determined by
sys.argv[1]- None (default): Normal mode - takes screenshots, solves puzzles, and performs mouse actions
- “test”: Test mode - reads from
debug_input.pnginstead of taking screenshots, skips mouse actions - “test_all”: Test all mode - runs solver on all images in
test_inputs/folder for benchmarking
Core Workflow
Normal Mode
Thenormal_mode(config: Config) function implements the main bot loop:
- Setup & Screenshot: Captures the game window or loads test image
- Inventory Analysis: Detects available aspects in inventory panels
- Board Parsing: Extracts the hexagonal grid from the screenshot
- Solution Generation: Solves the research puzzle using the ring solver algorithm
- Aspect Placement: Automatically places aspects via mouse control
- Wait for Next: Waits for user input (Enter or global hotkey) to process next board
Test All Mode
Thetest_all_samples(config: Config) function benchmarks the solver:
Key Functions
Image Processing
Solving
SolvingHexGrid with applied paths.Mouse Control
User Input
Type Aliases
The codebase uses several type aliases for clarity:Configuration
The bot uses aConfig dataclass loaded from config.toml: