How 1bananachicken/maante works
Purpose and Runtime
MaaNTE is a Windows automation assistant for the game 《异环》, built on MaaFramework. It recognizes game UI/audio and simulates ordinary input; it does not modify game files. The primary runtime is Python plus MaaFramework pipeline resources, targeting a 1280×720 windowed game client. Dependencies are declared in requirements.txt; release/build orchestration begins at build.py.
Entry and Framework Boundary
agent/main.py is the Python agent entry point exposed to MaaFramework. It bridges declarative pipeline nodes to custom Python actions under agent/custom/action/. Shared runtime concerns—logging, localization, screen access, process/window focus, and environment handling—sit in:
• agent/utils/logger.py
• agent/utils/i18n.py
• agent/utils/maafocus.py
The framework executes task/pipeline definitions; Python code is invoked for behavior that needs state, decision logic, external input, or nonstandard recognition.
Declarative Automation Layer
Pipeline JSON defines recognition, actions, transitions, and scene/task flow. It is the main orchestration boundary between image assets and Python actions:
• assets/resource/base/pipeline/
• assets/resource/tasks/
• assets/resource/tasks/preset/
Tasks expose user-selectable automations and presets compose them into daily/AFK/realtime runs. Pipeline schemas in deps/tools/pipeline.schema.json and custom-action schemas constrain this contract.
Visual Recognition and Scene Control
Screen-driven flows use templates and model assets to detect UI state, then pipelines dispatch clicks, keys, or custom actions. Core scene definitions and shared button recognition are centralized in:
• assets/resource/base/pipeline/SceneManager/
• assets/resource/base/pipeline/Common/Button/
• assets/resource/base/image/
This separation lets feature pipelines reuse canonical world/login/menu/scenes and UI controls rather than embedding game-state detection in each feature.
Feature Action Modules
Feature implementations are modular Python action packages paired with pipeline/task definitions. Major domains include fishing, coffee, furniture, rewards, heist, Tetris, rhythm, piano, sound-triggered dodge, and realtime assistance:
• agent/custom/action/AutoFish/
• agent/custom/action/AutoCoffee/
• agent/custom/action/PinkPawHeist/
Each module consumes framework recognition/state and emits input or follow-up control decisions. Feature-specific assets and pipelines remain under corresponding assets/resource/base/image/ and assets/resource/base/pipeline/ subtrees.
Navigation and Movement Subsystem
Navigation is a distinct stateful subsystem: routes and map coordinates feed route planning, waypoint execution, local/online navigation actions, and an optional WebSocket service:
• agent/custom/action/Navi/route_runner.py
• agent/custom/action/Navi/navigation_server.py
• agent/custom/action/Navi/route_websocket_service.py
Persistent route data lives in assets/resource/routes/; teleport point metadata is in assets/resource/base/map_teleport/. Movement and teleport pipelines provide reusable lower-level execution boundaries.
Specialized Perception and Control
Not all automation is template-only. Audio dodge listens for sound cues and triggers dodge/counter input:
• agent/custom/action/SoundTrigger/SoundListener.py
• agent/custom/action/SoundTrigger/SoundDodgeAction.py
• assets/resource/base/sounds/
Game-playing features embed local decision engines, notably Tetris board/piece/scene analysis and rhythm detection:
• agent/custom/action/Tetris/
• agent/custom/action/rhythm/
• agent/custom/action/auto_piano/
Distribution, UI, and External Services
The repository supplies automation content rather than a standalone web application. MaaFramework and MXU provide the external automation/runtime/UI foundation; model/common assets are represented by assets/MaaNTEModels and assets/MaaCommonAssets. assets/interface.json defines the framework-facing interface. GitHub Actions handle installation, schema synchronization, i18n sync, releases, and documentation notification under .github/workflows/.
Main entry points: pipeline Base pipelines · action Feature action modules · route_runner.py Route runner · main.py Python agent entry
Components 22
Agent Runtime
- Python agent entry · Exposes custom Python behavior to MaaFramework.
agent/main.py - Runtime utilities · Logging, localization, focus, screen, and environment support.
agent/utils/logger.py - Feature action modules · Stateful automation behavior for game features.
agent/custom/action
Automation Resources
- Base pipelines · Declarative recognition, input, transitions, and scene flow.
assets/resource/base/pipeline - Tasks and presets · User-selectable automations and composed daily, AFK, and realtime runs.
assets/resource/tasks - Scene manager · Canonical world, login, and menu state detection.
assets/resource/base/pipeline/SceneManager - Shared button recognition · Reusable UI-control recognition.
assets/resource/base/pipeline/Common/Button - Image and model assets · Templates and models used for screen recognition.
assets/resource/base/image - Pipeline schema · Constrains pipeline and custom-action contracts.
deps/tools/pipeline.schema.json
Navigation
- Route data · Saved routes and map coordinates.
assets/resource/routes - Teleport metadata · Teleport point definitions.
assets/resource/base/map_teleport - Route runner · Plans and executes waypoint movement.
agent/custom/action/Navi/route_runner.py - Navigation server · Supports local and online navigation requests.
agent/custom/action/Navi/navigation_server.py - Route WebSocket service · Optional external route-control interface.
agent/custom/action/Navi/route_websocket_service.py
Specialized Control
- Audio dodge control · Detects sound cues and issues dodge or counter input.
agent/custom/action/SoundTrigger/SoundListener.py - Sound assets
assets/resource/base/sounds - Local gameplay engines · Tetris, rhythm, and piano analysis and control.
agent/custom/action/Tetris
Integration & Delivery
- Framework interface · Defines the MaaFramework-facing interface.
assets/interface.json - Build orchestration · Starts release and build orchestration.
build.py - GitHub workflows · Automation for installation, schemas, i18n, releases, and documentation.
.github/workflows - Shared Maa assets
assets/MaaCommonAssets
Other components
- MaaFramework / MXU · Executes automation pipelines and provides the UI foundation.
Connections 22
- MaaFramework / MXU → Python agent entry: loads agent
- MaaFramework / MXU → Base pipelines: executes
- MaaFramework / MXU → Framework interface: reads
- Python agent entry → Feature action modules: dispatches
- Python agent entry → Runtime utilities: uses
- Base pipelines → Feature action modules: invokes custom actions
- Tasks and presets → Base pipelines: composes
- Base pipelines → Scene manager: reuses scenes
- Base pipelines → Shared button recognition: reuses controls
- Scene manager → Image and model assets: recognizes with
- Shared button recognition → Image and model assets: matches
- Pipeline schema → Base pipelines: validates
- Feature action modules → Route runner: includes
- Route runner → Route data: reads
- Route runner → Teleport metadata: uses
- Navigation server → Route runner: requests navigation
- Route WebSocket service → Navigation server: serves requests
- Feature action modules → Audio dodge control: includes
- Audio dodge control → Sound assets: listens for cues
- Feature action modules → Local gameplay engines: includes
- Build orchestration → GitHub workflows: supports delivery
- MaaFramework / MXU → Shared Maa assets: uses