Add your description here
Project description
RevomonAuto
Automation helpers for the Revomon Android game running under BlueStacks, built on top of the Bluepyll automation framework.
This repository provides a state-machine-driven controller (RevoAppController) and a ready-to-run demo script (test.py) that exercises typical in-game flows like launching the app, logging in, navigating menus, interacting with the TV, and running basic battle actions.
Requirements
- Python 3.13+ (project targets
>=3.13perpyproject.toml) - Windows (tested) with BlueStacks installed
Installation (UV only)
- Create and activate a virtual environment:
uv venv
# On PowerShell
. .\.venv\Scripts\Activate.ps1
- Install dependencies declared in
pyproject.toml/uv.lock:
uv sync
- Verify your Python version is 3.13+:
python -V
Project layout
-
src/revomonauto/controllers/revo_controller.pyHigh-level automation API. Inherits fromBluepyllControllerandRevomonApp. Exposes actions such asopen_revomon_app(),start_game(),log_in(),open_main_menu(),open_tv(),open_attacks_menu(),run_from_battle(), etc. -
src/revomonauto/models/revo_app.pyApp model and state machines:LoginState,BattleState,MenuState,TVState. Holds contextual attributes liketv_current_page,tv_slot_selected,current_city, and anEventfor auto-run. -
src/revomonauto/models/action.pyAction logging utilities:Action: dict-like fixed schema for per-action results.Actions: list-like container that only acceptsAction.@actiondecorator: wraps controller methods to capture state diffs and append tocontroller.actionsafterwait_for_action().
-
src/revomonauto/revomon/revomon_ui.pyStatic UI descriptors asUIElementinstances with image template paths, screenpositionandsize. These driveclick_ui(...)targeting and define OCR regions for battle info extraction. -
test.pyExample script showing the intended usage ofRevoAppControllerend-to-end.
Running the demo
From the repository root:
uv run test.py
test.py will:
- Instantiate
RevoAppController. - Open the Revomon app, start the game, and log in.
- Open/close the main menu and navigate submenus (PVP, Wardrobe, Team/Bag, Friends, Settings, Revodex, Market, Discussion, Clan).
- Interact with the TV (select slots, search for a Revomon).
- In battle: open the attacks menu, OCR current moves, open/close the battle bag, and run from battle.
- Log every action and final
controller.actions(which includes state diffs).
How it works
-
Controller methods in
revo_controller.pyare annotated with@actionfrommodels/action.py. The decorator:- Snapshots state before and after each method call.
- Calls
self.wait_for_action(action=...)to let Bluepyll observe the UI state change. - Appends a structured
Actionwith astate_diffintocontroller.actions.
-
UI automation is delegated to Bluepyll via methods inherited from
BluepyllController, including:click_ui([UIElement, ...], max_tries=...)click_coords((x, y))capture_screenshot()- App lifecycle helpers:
open_app(app=self, ...),close_app(app=self)
-
OCR flows (battle info):
extract_regions(...)crops regions from screenshots and saves them tosrc/revomonauto/revomon/battles/{label}.png.- The controller then calls
self.img_txt_checker.read_text(path, allowlist=...)(provided by Bluepyll) to parse text from those images. extract_health_percentage(...)scans a midline of the health bar image to estimate percentage filled.
Adding new automation
- Define new UI targets in
src/revomonauto/revomon/revomon_ui.pyasUIElemententries with accuratepath,position,size, and optionalconfidence/ele_txt. - Implement a controller method in
src/revomonauto/controllers/revo_controller.py:- Decorate with
@action. - Gate behavior on the appropriate state machines (see
models/revo_app.py). - Use Bluepyll helpers like
click_ui,click_coords, andcapture_screenshot.
- Decorate with
- Update or create a script like
test.pyto exercise the new flow.
Logs and artifacts
- The demo logs to console and a timestamped file (from
test.py). - OCR crops are saved under
src/revomonauto/revomon/battles/by label. - If interactions fail, check
controller.actionsat the end of a run to inspect state diffs and the last successful step.
Troubleshooting
-
BlueStacks not detected / ADB not connected:
- Ensure BlueStacks is installed and running.
- Bluepyll should auto-connect ADB; check logs for ADB connection attempts.
-
UI element not found:
- Verify your BlueStacks resolution matches what the UI element coordinates expect (the project assumes 1920x1080 based on positions in
revomon_ui.py). - Confirm template image paths exist under
src/revomonauto/revomon/game_ui/...and have sufficientconfidence.
- Verify your BlueStacks resolution matches what the UI element coordinates expect (the project assumes 1920x1080 based on positions in
-
OCR results are noisy:
- Inspect the cropped images in
src/revomonauto/revomon/battles/. - Adjust region
position/sizeinrevomon_ui.pyor refine post-processing in the controller.
- Inspect the cropped images in
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file revomonauto-0.1.0.tar.gz.
File metadata
- Download URL: revomonauto-0.1.0.tar.gz
- Upload date:
- Size: 63.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049c124f1f5f1805792ae13dfc4a9ee9c0997d932fb8a5bedc423cd06d7f9edf
|
|
| MD5 |
fb994baa7a1b26c77b3539946dbbfda5
|
|
| BLAKE2b-256 |
9923dd948d229b4cad8293e00dfe1f406065d6be07c69540645c98936820e0f8
|
File details
Details for the file revomonauto-0.1.0-py3-none-any.whl.
File metadata
- Download URL: revomonauto-0.1.0-py3-none-any.whl
- Upload date:
- Size: 63.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
823b903c5b666fc720f4b833804bf8b75dff958fbe565701a0bbd2cb74e56c22
|
|
| MD5 |
a060d0215a965bb410fc342b35d6eb5c
|
|
| BLAKE2b-256 |
81d077c1975c02ed09fbb3e16c96fae602c6ac150ad32b90b7016dff635204b5
|