An automation tool for Rise of Kingdoms mobile game using ADB (Android Debug Bridge) and LDPlayer emulator with a PyQt5 GUI interface.
- 🎮 Automated gameplay actions for Rise of Kingdoms
- 🖥️ PyQt5-based GUI for easy control
- 📱 Support for LDPlayer Android emulator
- 🤖 2Captcha integration for captcha solving
- 🔄 Multi-threaded worker system for concurrent operations
- 📸 Screenshot capture and image processing
- ⚙️ Configurable automation options
- Python 3.7+
- LDPlayer Android Emulator
- ADB (Android Debug Bridge)
- 2Captcha API key (for captcha solving)
- Clone the repository:
git clone https://github.com/nedsion/rok-auto.git
cd rok-auto- Create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\activate- Install required dependencies:
pip install -r requirements.txt- Configure the application:
- Edit
config.jsonto set your LDPlayer installation path:
{ "LD_PATH": "D:\\LDPlayer\\LDPlayer3.0" }- Update
config.pywith your 2Captcha API key
- Edit
LD_PATH: Path to your LDPlayer installation directory
Key configuration options:
TWO_CAPTCHA_API_KEY: Your 2Captcha API key for automated captcha solvingGAME_PACKAGE: Package name of the game (default:com.rok.gp.vn)PATH_SCREEN_SHOT_FOLDER: Directory for storing screenshotsTIME_WAIT_TO_OPEN_GAME: Wait time for game to launch (seconds)TIME_WAIT_TO_SOLVE_CAPTCHA_MAX/MIN: Captcha solving timeout range
- Launch LDPlayer emulator
- Run the main application:
python main.py- The GUI will open where you can:
- Select emulator instances
- Configure automation actions
- Set delay times between actions
- Monitor execution logs
- Start/stop automation tasks
.
├── main.py # Main GUI application
├── rok_core.py # Core automation logic
├── adb_helper.py # ADB connection helper
├── LD_helper.py # LDPlayer integration
├── LD_ADB_helper.py # Alternative ADB helper
├── uia_helper.py # UI automation helper
├── helper_2captcha.py # 2Captcha integration
├── config.py # Configuration constants
├── config.json # User configuration file
├── requirements.txt # Python dependencies
├── images/ # Image assets
├── output/ # Output directory
│ ├── config.json
│ ├── images/
│ └── screenshot/
├── screenshot/ # Screenshot storage
└── test/ # Test files
Main automation engine that handles:
- Device connection via ADB
- Screenshot capture and processing
- Image recognition
- Captcha detection and solving
- Game action automation
Multi-threaded worker for executing automation tasks:
- Asynchronous task execution
- Progress updates via signals
- Configurable actions and delays
LDPlayer emulator management:
- Launch/quit emulator instances
- ADB device enumeration
- Process management
Key packages:
PyQt5: GUI frameworkadbutils: ADB communicationopencv-python: Image processingnumpy: Numerical operationsrequests: HTTP client for API callsPillow: Image manipulation
See requirements.txt for complete list.
The application includes license key verification functionality that connects to:
https://nedsion.xyz/api/license/?key=<your-key>
Screenshots are automatically saved to the screenshot/ directory during automation runs.
Contributions are welcome! Please feel free to submit issues or pull requests.
This tool is for educational purposes only. Use at your own risk. Automated gameplay may violate the game's Terms of Service.
For issues and questions, please create an issue on the GitHub repository.
nedsion