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

A powerful automation framework for the Revomon Android game, built on top of the Bluepyll automation framework. RevomonAuto provides comprehensive UI automation, battle intelligence, and game data access for Revomon.

Python Version License

๐ŸŽฎ Features

Automation Capabilities

  • Full App Lifecycle Management: Automated app opening, closing, and login sequences
  • Menu Navigation: Navigate all main menus and submenus (Wardrobe, Bag, Friends, Settings, Revodex, Market, Discussion, Clan)
  • PVP Queue Management: Enter and exit PVP queues automatically
  • Battle Automation:
    • OCR-based move extraction with PP tracking
    • Health monitoring via pixel analysis
    • Pluggable battle strategies (Random, Custom AI)
    • Auto-run from battles (background thread)
  • TV/PC Navigation: Search and select Revomon in storage
  • Action Tracking: Full audit trail with state diffs for debugging

Battle Intelligence

  • Real-time OCR: Extract mon names, levels, HP percentages, and moves
  • Move Validation: Filter moves by PP availability
  • Strategy Pattern: Extensible battle AI system
  • Health Bar Analysis: Pixel-based HP calculation

Game Data Access

17+ specialized client libraries for querying game data:

  • RevomonClient: Search by name, type, ability
  • MovesClient: Physical, special, and status moves
  • BattleMechanicsClient: Damage calculation, type effectiveness, team coverage analysis
  • EvolutionClient: Evolution trees and optimal path finding
  • WeatherClient: Weather synergy analysis
  • StatusEffectsClient: Status condition strategy
  • TypesClient, ItemsClient, NaturesClient, LocationsClient, and more

๐Ÿ“‹ Requirements

  • Python: 3.13 or higher
  • Operating System: Windows (BlueStacks integration)
  • BlueStacks: Android emulator
  • ADB: Android Debug Bridge (included with BlueStacks)

๐Ÿš€ Installation

We recommend using uv for package management.

Using uv (Recommended)

# Clone the repository
git clone https://github.com/IAmNo1Special/RevomonAuto.git
cd RevomonAuto

# Install dependencies with uv
uv sync

# Run the example
uv run examples/main.py

Using pip

# Clone the repository
git clone https://github.com/IAmNo1Special/RevomonAuto.git
cd RevomonAuto

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -e .

# Run the example
python examples/main.py

๐ŸŽฏ Quick Start

Basic Automation

from bluepyll import BluePyllController
from revomonauto.models.revomon_app import RevomonApp

# Initialize
controller = BluePyllController()
revomon_app = RevomonApp(controller)

# Start BlueStacks and open app
controller.bluestacks.open()
revomon_app.open_revomon_app()

# Login sequence
revomon_app.start_game()
revomon_app.login()

# Navigate menus
revomon_app.open_main_menu()
revomon_app.open_menu_bag()
revomon_app.close_menu_bag()
revomon_app.close_main_menu()

# Enter PVP queue
revomon_app.enter_pvp_queue()

Battle Automation

# Wait for battle to start, then automate
while True:
    if revomon_app.is_in_battle_scene():
        # Open attacks menu
        revomon_app.open_attacks_menu()
        
        # Choose a random move
        revomon_app.choose_move()
        
        # Or use a custom strategy
        from revomonauto.models.strategies import BattleStrategy
        
        class AlwaysFirstMove(BattleStrategy):
            def select_move(self, valid_move_names):
                return valid_move_names[0]
        
        revomon_app.choose_move(strategy=AlwaysFirstMove())

Auto-Run from Battles

# Enable auto-run (runs from all battles automatically)
revomon_app.toggle_auto_run()

# Your automation continues while battles are automatically escaped
# ...

# Disable when done
revomon_app.toggle_auto_run()

Game Data Access

from revomonauto.data.gradex_clients import (
    RevomonClient,
    MovesClient,
    BattleMechanicsClient,
    EvolutionClient
)

# Initialize clients
revomon_client = RevomonClient()
moves_client = MovesClient()
battle_client = BattleMechanicsClient()

# Find Revomon by type
fire_types = revomon_client.get_revomon_by_type("fire")
print(f"Fire types: {[r['name'] for r in fire_types[:5]]}")

# Get all status moves
status_moves = moves_client.get_status_moves()

# Analyze team type coverage
team = [
    revomon_client.get_revomon_by_name("gorcano"),
    revomon_client.get_revomon_by_name("blizzora")
]
coverage = battle_client.analyze_type_coverage(team)
print(f"Type coverage: {coverage['overall_coverage']:.1%}")

# Find optimal evolution path
evolution_client = EvolutionClient()
paths = evolution_client.find_optimal_evolution_path(
    target_stats={"spa": 1.0, "spe": 0.7},
    max_evolutions=3
)

๐Ÿ“ Project Structure

RevomonAuto/
โ”œโ”€โ”€ src/revomonauto/
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ revomon_app.py       # Main automation controller
โ”‚   โ”‚   โ”œโ”€โ”€ states.py            # GameState and BattleState enums
โ”‚   โ”‚   โ”œโ”€โ”€ action.py            # Action tracking system
โ”‚   โ”‚   โ”œโ”€โ”€ strategies.py        # Battle strategy implementations
โ”‚   โ”‚   โ””โ”€โ”€ revomon_ui/          # UI element definitions
โ”‚   โ”‚       โ”œโ”€โ”€ assets/          # Image assets for UI matching
โ”‚   โ”‚       โ”œโ”€โ”€ elements/        # UI element definitions
โ”‚   โ”‚       โ””โ”€โ”€ screens/         # Screen object models
โ”‚   โ””โ”€โ”€ data/
โ”‚       โ””โ”€โ”€ gradex_clients/      # Game data client libraries
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ main.py                  # Full automation workflow
โ”‚   โ””โ”€โ”€ example_client_usage.py # Data client examples
โ”œโ”€โ”€ tests/                       # Unit tests
โ”œโ”€โ”€ pyproject.toml               # Project configuration
โ””โ”€โ”€ README.md                    # This file

๐Ÿง  State Management

RevomonAuto uses a dual state machine system for robust automation:

GameState

  • NOT_STARTED, STARTED - Login flow
  • OVERWORLD - Free roaming
  • MAIN_MENU - Menu overlay
  • MENU_BAG, WARDROBE, FRIENDS_LIST, SETTINGS, REVODEX, MARKET, DISCUSSION, CLAN - Submenus
  • PVP_QUEUE - Waiting for PVP match
  • BATTLE - In combat
  • TV - PC/storage interface

BattleState (Sub-state when in BATTLE)

  • IDLE - Can attack, use bag, or run
  • ATTACKS_MENU_OPEN - Move selection visible
  • BAG_OPEN - Bag menu visible
  • WAITING_FOR_OPPONENT - Turn being processed

State validation is enforced via the @requires_state decorator:

@requires_state(GameState.BATTLE)
@action
def choose_move(self, strategy=None):
    # Only executes if in BATTLE state
    ...

๐ŸŽฒ Creating Custom Battle Strategies

Extend the BattleStrategy abstract base class:

from revomonauto.models.strategies import BattleStrategy
from revomonauto.data.gradex_clients import MovesClient, TypesClient

class SuperEffectiveStrategy(BattleStrategy):
    def __init__(self, opponent_type):
        self.opponent_type = opponent_type
        self.moves_client = MovesClient()
        self.types_client = TypesClient()
    
    def select_move(self, valid_move_names):
        # Get move objects
        moves = [self.moves_client.get_move_by_name(name) 
                 for name in valid_move_names]
        
        # Find super-effective moves
        for move in moves:
            effectiveness = self.types_client.get_effectiveness(
                move['type'], self.opponent_type
            )
            if effectiveness > 1.0:
                return move['name']
        
        # Fallback to first valid move
        return valid_move_names[0]

# Use your custom strategy
revomon_app.choose_move(strategy=SuperEffectiveStrategy("grass"))

๐Ÿ“Š Action Tracking

Every automated action is tracked with full state diffs:

# Execute actions
revomon_app.open_main_menu()
revomon_app.enter_pvp_queue()

# Review action history
for action in revomon_app.actions:
    print(f"Action: {action['action_name']}")
    print(f"Status: {action['status']}")
    print(f"State changes: {action['state_diff']}")

Example output:

Action: open_main_menu
Status: True
State changes: {
    'game_state': {'prev': 'OVERWORLD', 'new': 'MAIN_MENU'}
}

๐Ÿงช Testing

# Run tests with uv
uv run pytest

# Run specific test
uv run pytest tests/test_choose_move.py

# Run with coverage
uv run pytest --cov=src/revomonauto

๐Ÿ”ง Configuration

Create a .env file in the project root (not tracked by git):

# BlueStacks configuration
BLUESTACKS_PATH=C:\Program Files\BlueStacks_nxt\HD-Player.exe
ADB_PATH=C:\Program Files\BlueStacks_nxt\HD-Adb.exe

# Game credentials (optional, for auto-login)
REVOMON_USERNAME=your_username
REVOMON_PASSWORD=your_password

โš ๏ธ Important Notes

Game Terms of Service

  • Use at your own risk: Automation may violate Revomon's Terms of Service
  • Account safety: No guarantees against detection or bans
  • Recommendation: Use on alternate accounts and add human-like delays

Limitations

  • Scene detection: May require manual intervention in some scenarios
  • OCR accuracy: ~95% accuracy, occasional errors in move/name detection
  • State synchronization: Uses fixed delays (1 second) which may need adjustment
  • Battle end detection: Manual input currently required to detect battle completion

๐Ÿ—บ๏ธ Roadmap

  • Background scene detection thread
  • Robust PVP queue state detection
  • Battle end detection
  • Error recovery and retry logic
  • Comprehensive test suite
  • CI/CD pipeline
  • Performance optimization (reduce sleep delays)
  • Docker support

๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Follow existing code style and patterns
  4. Add tests for new functionality
  5. Update documentation as needed
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/YOUR_USERNAME/RevomonAuto.git
cd RevomonAuto

# Install development dependencies
uv sync --all-extras

# Run tests
uv run pytest

# Run linter
uv run ruff check .

# Format code
uv run ruff format .

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Bluepyll Framework: Core automation capabilities
  • Revomon Community: Game data and mechanics information
  • Contributors: All those who have contributed to this project

๐Ÿ“ž Support

โšก Advanced Examples

Multi-Account Farming

accounts = [
    {"username": "account1", "password": "pass1"},
    {"username": "account2", "password": "pass2"}
]

for account in accounts:
    # Login with different account
    revomon_app.login(account)
    
    # Enable auto-run
    revomon_app.toggle_auto_run()
    
    # Farm for 1 hour
    time.sleep(3600)
    
    # Logout
    revomon_app.quit_game()

Team Optimization

from revomonauto.data.gradex_clients import (
    RevomonClient, EvolutionClient, BattleMechanicsClient
)

# Find Revomon with best special attack evolution path
evolution_client = EvolutionClient()
paths = evolution_client.find_optimal_evolution_path(
    target_stats={"spa": 1.0, "spe": 0.8, "spd": 0.6},
    max_evolutions=3
)

# Build a balanced team
battle_client = BattleMechanicsClient()
team = build_balanced_team(paths[:6])

# Analyze coverage
coverage = battle_client.analyze_type_coverage(team)
print(f"Team covers {coverage['covered_types']}/{coverage['total_types']} types")

Disclaimer: This project is not affiliated with or endorsed by Revomon. Use at your own risk.

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.3.1.tar.gz (63.9 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.3.1-py3-none-any.whl (63.9 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for revomonauto-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1323ad96ca4a2746bbf449ec7ca8e67e1cc0fc468e3d816426b0de2fa6e6db9c
MD5 81dfdad5af5b9807a1e05861eec62104
BLAKE2b-256 ce97700552c0aa140c830bcfdd80b4555d8e1914cb9e6446c4e4cc62221d67b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for revomonauto-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdb4866179aabe6fed3633c1985f928952e62f52e93498bcddf9f26b596b6fc6
MD5 db85220e41c3fa161808421f538df42c
BLAKE2b-256 52c03a5976f6041c6ab0b860aa77b7bb6fbce1323476fd7cb3f234f5e2c5db37

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