Skip to main content

Automation helpers for the Revomon Android game running under BlueStacks, built on top of the Bluepyll automation framework.

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.13 per pyproject.toml)
  • Windows (tested) with BlueStacks installed

Installation (UV only)

  1. Create and activate a virtual environment:
uv venv
# On PowerShell
. .\.venv\Scripts\Activate.ps1
  1. Install dependencies declared in pyproject.toml / uv.lock:
uv sync
  1. Verify your Python version is 3.13+:
python -V

Project layout

  • src/revomonauto/controllers/revo_controller.py High-level automation API. Inherits from BluepyllController and RevomonApp. Exposes actions such as open_revomon_app(), start_game(), log_in(), open_main_menu(), open_tv(), open_attacks_menu(), run_from_battle(), etc.

  • src/revomonauto/models/revo_app.py App model and state machines: LoginState, BattleState, MenuState, TVState. Holds contextual attributes like tv_current_page, tv_slot_selected, current_city, and an Event for auto-run.

  • src/revomonauto/models/action.py Action logging utilities:

    • Action: dict-like fixed schema for per-action results.
    • Actions: list-like container that only accepts Action.
    • @action decorator: wraps controller methods to capture state diffs and append to controller.actions after wait_for_action().
  • src/revomonauto/revomon/revomon_ui.py Static UI descriptors as UIElement instances with image template paths, screen position and size. These drive click_ui(...) targeting and define OCR regions for battle info extraction.

  • tests/test.py Example script showing the intended usage of RevoAppController end-to-end.

Running the demo

From the repository root:

uv run tests/test.py

tests/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.py are annotated with @action from models/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 Action with a state_diff into controller.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 to src/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

  1. Define new UI targets in src/revomonauto/revomon/revomon_ui.py as UIElement entries with accurate path, position, size, and optional confidence and ele_txt.
  2. 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, and capture_screenshot.
  3. Update or create a script like tests/test.py to exercise the new flow.

Logs and artifacts

  • The demo logs to console and a timestamped file (from tests/test.py).
  • OCR crops are saved under src/revomonauto/revomon/battles/ by label.
  • If interactions fail, check controller.actions at 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 sufficient confidence.
  • OCR results are noisy:

    • Inspect the cropped images in src/revomonauto/revomon/battles/.
    • Adjust region position/size in revomon_ui.py or refine post-processing in the controller.

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

revomonauto-0.2.1.tar.gz (64.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revomonauto-0.2.1-py3-none-any.whl (64.3 MB view details)

Uploaded Python 3

File details

Details for the file revomonauto-0.2.1.tar.gz.

File metadata

  • Download URL: revomonauto-0.2.1.tar.gz
  • Upload date:
  • Size: 64.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for revomonauto-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c9ec4c1076141ae2189f9f96a12d8ddee60b5f175bc960a093c4a4c625ef7e45
MD5 a5d84587ad0a992053f98e39d9153e31
BLAKE2b-256 18e4b9972a35db37710ecca5da219851e5fc2d426573976a0a484dd30c87596c

See more details on using hashes here.

File details

Details for the file revomonauto-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for revomonauto-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2efb33777144f2d3e3a97fac456fe961b58249c7e1ce7819e7b1dc822f156996
MD5 dbdaaee473cd9b942a8004e783031698
BLAKE2b-256 68049c9a24780b3de5cdd52a659d07fedd5aadeffddc07f2754a2020a9f4c492

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page