Autonomous game agent using Tesseract OCR, MVC Architecture, and ETL pipelines for real-time strategy.
An advanced, autonomous bot for Tibianic-like Pokémon MMORPGs, built with Python, OpenCV, and Tesseract OCR. This project demonstrates the power of computer vision and state machine logic for game automation.
Disclaimer: This project is for educational and research purposes only. Use it at your own risk. The author is not responsible for any bans or penalties incurred while using this software.
- Autonomous Navigation: Detects "Goto" buttons and mission prompts to navigate automatically.
- Intelligent Battle System:
- Reads enemy names and your own Pokémon/HP via OCR.
- Makes smart decisions (Fight vs. Flee) based on type advantages.
- Calculates damage multipliers (STAB, effectiveness).
- Computer Vision (Perception):
- Real-time screen capture using
mss. - State detection (Exploring, Battling, Dialog).
- Shiny Pokémon detection with audible alarms.
- Real-time screen capture using
- OCR Integration: Uses Tesseract to read game text (names, levels, chat).
- Configurable: Highly customizable behavior via
config/settings.yaml.
- Python: Core logic and control.
- OpenCV: Image processing and template matching.
- Tesseract OCR: Optical Character Recognition for reading text.
- MSS: Ultra-fast cross-platform screen capture.
- PyAutoGUI: Simulating mouse and keyboard actions.
- Loguru: Pleasant execution logging.
- Windows OS (Required for
winsoundalerts and specific input handling). - Python 3.8+ installed.
- Tesseract OCR installed:
- Download and install from UB-Mannheim/tesseract/wiki.
- Ensure the installation path matches the one in your
config/settings.yaml(default:C:\Program Files\Tesseract-OCR\tesseract.exe).
-
Clone the repository:
git clone https://github.com/Fesisp/PokeBot.git cd PokeBot -
Install dependencies:
pip install -r requirements.txt
-
Configure Tesseract: Open
config/settings.yamland verify theocr.tesseract_cmdpath points to your local Tesseract executable.
- Launch the Game Client and ensure it is visible on the screen.
- Run the Bot:
python run_bot.py
- Controls:
- The bot will start capturing the screen and logging actions.
- Stop: Press
Ctrl+Cin the terminal to stop the bot gracefully.
PokeBot/
├── assets/ # Template images for OpenCV matching
├── config/ # Configuration files (settings.yaml)
├── data/ # Game knowledge (Pokedex, moves, types JSONs)
├── docs/ # Documentation and design overviews
├── src/ # Source code
│ ├── action/ # Mouse/Keyboard inputs
│ ├── core/ # Main loop and bot controller
│ ├── decision/ # Battle logic and strategy
│ ├── knowledge/ # Data managers (PokeAPI, Team)
│ ├── perception/ # Vision, OCR, and state detection
│ └── utils/ # Helper functions
├── tests/ # Unit tests
└── run_bot.py # Entry point
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.