How fabian57fabian/archero_bot_57 works
Project type and purpose
• Archero Bot 57 is a desktop‐based automation tool (open‐source Python application) with a GUI front end that controls a mobile game (Archero) via adb (USB/Nox emulator). It uses MVC for its two main interfaces (GameController and TouchManager) plus a core “bot engine” that implements gameplay logic, screen analysis, and device commands.
Main components
a. User interfaces (MVC layers)
• GameController (GameControllerView, GameControllerController, GameControllerModel)
• TouchManager (TouchManagerView, TouchManagerController, TouchManagerModel)
• QMyWidgets: custom Qt widgets shared by both UIs (e.g. QActionTap, QDarkButton)
b. Core bot engine
• src/ directory:
• GameScreenConnector – takes screenshots, reads pixels
• UsbConnector – adb wrapper, sends taps/swipes
• CaveDungeonEngine & BotStrategies – high‐level gameplay loops and decision logic
• GameChapters, StatisticsManager, LocalEngineSettingsManager, update_manager – auxiliary services
• WorkerThread – offloads long‐running tasks (screenshots, device commands)
c. Data layer
• datas/ folder: JSON templates for coordinates, abilities, tier lists, general templates
• DeveloperScripts/: offline utilities to extract/update coordinate dictionaries, ability templates, etc.
d. External interfaces
• ADB (USB connection or Nox emulator)
e. Testing
• tests/: unit tests for core engine modules (CaveDungeonEngine, Utils, settings manager)
Relationships and interactions
• User clicks “Start” in GameControllerView → GameControllerController invokes GameControllerModel.start()
• Model delegates to Bot engine:
• WorkerThread ↔ GameScreenConnector (capture screen → detect energy, level state)
• CaveDungeonEngine uses BotStrategies + GameScreenConnector + UsbConnector to decide next action and perform tap/swipe
• StatisticsManager logs results to datas/*.csv
• LocalEngineSettingsManager reads/writes user preferences
• TouchManager UI works similarly but focuses on coordinate‐checking flows: reading screenshots folder, allowing the user to adjust coordinate templates stored under datas/ and writing out updated JSON.
• DeveloperScripts operate offline: independent CLI tools that generate or verify datas/* files, called manually outside the MVC/bot runtime.
Architectural patterns and design principles
• MVC for both GUI apps (separate View/Controller/Model layers).
• Single‐process multi‐threading (WorkerThread) to keep UI responsive.
• Layered architecture:
1. Presentation (Qt UIs)
2. Application logic (controllers + models + engine)
3. Device abstraction (adb wrapper)
4. Data access (JSON templates, csv files)
• Dependency injection via constructor parameters (models receive engine, settings, etc.)
• Extensibility: DeveloperScripts and datas/ folder allow adding new templates or coordinate sets without changing code.
Essential elements to capture
• MVC separation and how engine services plug into the controllers/models