Core Program Overview
The core program (wess09/AzurPilot, default branch master) is the sole repository implementing game automation logic. The desktop launcher and Android host serve exclusively as execution environments.
Core Subsystems
| Subsystem | Key Directories | Responsibilities |
|---|---|---|
| Entry Points | alas.py, gui.py, mcp_server_sse.py, tui.py | Scheduler loop, WebUI server, MCP service, terminal interface |
| Runtime | module/api/, module/runtime/ | WebSocket routing, process supervision, updates, remote access, account vault |
| Business | module/<feature>/, campaign/ | Feature modules implementing run() and campaign map graphs |
| Foundation | module/device/, ui/, ocr/, map/, combat/ | Screenshots, input injection, UI navigation, OCR, pathfinding, battle logic |
| Data | config/, SQLite database, assets/ | User configs, statistics, persistent states, 4-server recognition assets |
Three-Tier Execution Model
-
gui.pyacts as the parent process. It serves HTTP/WebSocket endpoints and static web assets without interacting with games directly. - Each instance runs in an isolated worker process. Spawned by
ProcessManagerviamultiprocessing.Process, runningAzurLaneAutoScript.loop(). - Tasks execute sequentially on the worker's main thread. Watchdogs and reporting routines run on secondary threads without executing concurrent game actions.
This architectural model explains several common behaviors:
- Stopping an instance terminates the worker process tree while leaving the WebUI server running.
- A single instance cannot execute two tasks concurrently; parallel execution requires multiple instances paired with multiple emulators.
- Closing
gui.pyshuts down active workers, as workers are supervised children of the backend process.
WebUI Structure
| Section | Route | Content |
|---|---|---|
| Home | / | Instance cards, start/stop switches, announcements |
| Instance Overview | /i/<instance>/overview | Active task, resource gauges, real-time logs, quick actions |
| Task Configuration | /i/<instance>/task/<task> | Forms dynamically rendered from task.yaml |
| Statistics | /i/<instance>/statistics | Reports for resources, sorties, Operation Siren, commissions, and inventory |
| Scheduler Program | /i/<instance>/task/SchedulerProgram | Visual graph-based scheduling orchestration |
| Mind Calculator | /i/<instance>/task/MindCalculator | Dock scanning and Cognitive Array cost calculator |
| Fleet Technology | /i/<instance>/task/FleetTechnology | Tech point scanning and fleet statistics |
| System Settings | /settings | Account vault, remote access, updates, theme settings |
| Configurations | /configs | Import, export, duplicate, and delete instances |
For detailed view breakdowns, read the WebUI Tour.
Task Categories
The task navigation menu derives from module/config/argument/task.yaml, organized into 12 top-level groups:
| Group | Category | Representative Tasks |
|---|---|---|
Alas | System | Emulator setup, error handling, backup, daily summary |
Farm | Sortie | Campaign maps 1/2/3, urgent commissions, 3-oil low-cost farming |
Event | Events | Event stages 1/2/3, raid battles, War Archives |
EventDaily | Event Dailies | Daily A/B/C/D/SP event clears |
Reward | Automated Claims | Commissions, research, dorm, Meowfficer, guild logistics |
DailyMission | Dailies | Daily challenges, limit challenges, hard mode, exercises |
Opsi | Operation Siren | Exploration, obscure sectors, abyssal zones, strongholds, intelligent scheduler |
Island | Cruise & Island Missions | Farmland, ranching, restaurants, manufacturing, daily gathering |
FleetManagement | Fleet Management | Fleet scanning and fleet composition inspector |
RunParams | Execution Parameters | Timing delays and device timeout thresholds |
Tool | Utilities | Semi-automation, performance benchmarks, OCR tests, uncensor tools |
Dashboard | Dashboard | Resource caps and gauge thresholds |
Review the Task Command Matrix for the full 102 task command catalog.
Dynamic Task Counts
Event releases dynamically add and remove tasks, altering method counts on alas.py. Documentation counts reflect current baseline versions.
Extending Capabilities
Authoring a new task requires matching identifiers in three locations plus one run() method:
- Register the task command and group inside
task.yaml. - Define the corresponding method on
alas.py(converting CamelCase to snake_case). - Create a module under
module/<feature>/providing arun()entry point. - Execute
uv run -m module.config.config_updaterto regenerate configuration schemas.
Read Adding a New Task for full development tutorials.