$ show BlueArchiveArisHelper/BAAH
BAAH (Blue Archive Aris Helper) is a Python-based automation tool for the mobile game Blue Archive. It automates daily tasks, combat, events, and other in-game activities through image recognition, OCR, and ADB-based emulator/device control. The application features a NiceGUI-powered desktop interface for configuration and task management, with support for multiple game servers (Global, Japan, CN, Bilibili, Steam) and cross-platform deployment (Windows, macOS, Linux, Android). The architecture follows a modular task-based design where each automation task (login, combat, cafe, etc.) inherits from a base Task class defining standardized lifecycle methods (pre_condition, on_run, post_condition). Game state detection relies on template matching via a Page class, while complex automation flows are built using composable actions from the define_actions module. Configuration is managed through a hierarchical system supporting user, software, session, and storage layers with i18n and post-processing capabilities. The GUI provides reusable components for list editing, screenshot capture, and task execution monitoring. Key external dependencies include OpenCV for image processing, ONNX Runtime for OCR, NiceGUI for the web-based GUI, and ADB for device communication. The tool stores user configurations as JSON files and maintains historical data in USER_STORAGE. Self-update functionality checks multiple sources (Gitee/GitHub/mirror) for new versions.
The LLM identified 9 files worth highlighting for reuse:
Defines the base Task class with standardized lifecycle (pre_condition/on_run/post_condition) and reusable utility methods (click, swipe, match_template, clear_popup, back_to_home). Isolated and used by all task modules, demonstrating a clean abstraction for game automation flows.
Implements the Page class for detecting game screens via template matching with configurable thresholds and regions. Self-contained foundation for game state detection used across tasks, showing effective use of computer vision principles.
Provides core action objects (ClickAction, SwipeAction, OCRAction, etc.) and precondition objects that can be combined to build complex automation flows. Demonstrates a plugin-like architecture with global registries and serialization/deserialization mechanisms.
Manages hierarchical configuration (user, software, session, storage) with default value inheritance, key mapping between config keys, and post-parse actions. Supports i18n and is widely imported, showing a robust, reusable configuration system.
A self-contained NiceGUI component for editing lists with add/remove/reorder capabilities. Isolated from specific task logic, demonstrating clean encapsulation of a common UI pattern.
Encapsulates screenshot capture, editing, and saving functionality within a NiceGUI interface. Reusable across different contexts for image annotation tasks.
Centralized internationalization resolver supporting CN/EN/JP language switching with fallback mechanisms. Demonstrates a clean, non-obvious pattern for managing multilingual strings in a desktop application.
Defines a base Sender class with email and HTTP implementations for pluggable notifications. Shows extensible design for alerting users about task results or errors.
Implements a heuristic-based algorithm for selecting the optimal timetable room based on multiple factors (student stats, facility levels). Encapsulates non-trivial decision logic in an isolated, reusable module.