An intelligent automation bot for the Eatventure mobile game using advanced computer vision and state machine architecture. The bot automatically detects on-screen elements, clicks buttons, manages upgrades, and progresses through game levels with Telegram notifications.
demo.mp4
Note: Upload your video to a GitHub issue/PR comment, then paste the auto-generated link here for best compatibility.
Direct Link: Watch Demo Video
- 🎯 Computer Vision: Advanced template matching using OpenCV with multi-template detection
- 🖱️ Intelligent Mouse Control: Automated clicking, holding, and dragging with forbidden zone protection
- 🔄 State Machine Architecture: Robust state management for complex game automation
- 📸 Window Capture: Direct window capture using Win32 API for optimal performance
- 🎨 Multi-Template Matching: Detects red icons using multiple template variations for accuracy
- 🛡️ Safe Zone Detection: Prevents accidental clicks in UI areas (menus, buttons) with configurable forbidden zones
- 📊 Comprehensive Logging: Detailed logs for debugging and monitoring
- 📱 Telegram Integration: Real-time notifications about bot activity and level completions
- 🎨 Visual Debugging: Optional overlay to visualize forbidden zones
- ⚙️ Highly Configurable: Easy configuration through
config.pywith extensive comments
The bot operates through several intelligent states:
- Find Red Icons: Scans the screen for collectible items using multi-template matching
- Click & Unlock: Automatically clicks detected icons and handles unlock prompts
- Upgrade Stations: Holds upgrade buttons to level up restaurants
- Open Boxes: Collects reward boxes automatically
- Stats Upgrade: Manages character statistics upgrades
- Smart Scrolling: Navigates through the game map intelligently
- Level Transitions: Detects and progresses to new levels with Telegram notifications
- Operating System: Windows 10/11
- Python: 3.8 or higher
- Android Device: Connected via scrcpy
pip install -r requirements.txt- Download scrcpy: https://github.com/Genymobile/scrcpy
- Extract scrcpy to a convenient location
- Connect your Android device via USB with USB debugging enabled
- Run scrcpy:
scrcpy --window-title "YourDeviceName"
Open config.py and configure the following settings:
# The exact title of your scrcpy window
# To find it: Look at the window's title bar after running scrcpy
WINDOW_TITLE = "SM-M315F" # Replace with your device nameHow to find your WINDOW_TITLE:
- Run scrcpy normally:
scrcpy --window-title "YourDeviceName" - Look at the window's title bar (usually shows device model like "SM-M315F", "Pixel 6", etc.)
- Copy that exact name to
config.py - Alternative: While bot is running, press X to test if the window is detected
The bot can send you real-time notifications via Telegram:
- 🤖 Bot start/stop events
- 🎉 Level completions with time tracking
- 📊 Progress updates
Setup Steps:
-
Create a Telegram Bot:
- Open Telegram and search for
@BotFather - Send
/newbotcommand - Follow instructions to create your bot
- Copy the bot token (looks like:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)
- Open Telegram and search for
-
Get Your Chat ID:
- Send any message to your bot
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for
"chat":{"id": YOUR_CHAT_ID(a number like1352878588)
-
Configure in config.py:
TELEGRAM_ENABLED = True # Set to False to disable notifications TELEGRAM_BOT_TOKEN = "your-bot-token-here" TELEGRAM_CHAT_ID = "your-chat-id-here"
Telegram Messages You'll Receive:
🤖 Bot Started- When you press Z to start⏹️ Bot Stopped- When you press Z to stop5. restaurant completed! Time spent: 03:45- After each level completion
Place your template images in the Assets/ folder. The bot needs these templates to recognize game elements:
Assets/
# The exact title of your scrcpy window (see in window title bar)
WINDOW_TITLE = "SM-M315F"
WINDOW_WIDTH = 360
WINDOW_HEIGHT = 780
# Master switch for all Telegram notifications
TELEGRAM_ENABLED = True # Set to False to disable
# Your bot credentials (get from @BotFather)
TELEGRAM_BOT_TOKEN = "your-token-here"
TELEGRAM_CHAT_ID = "your-chat-id-here"MATCH_THRESHOLD = 0.98 # General matching confidence (0.0-1.0)
RED_ICON_THRESHOLD = 0.95 # Red icon detection threshold
RED_ICON_MIN_MATCHES = 3 # Minimum template matches required# Shows red overlay rectangles on forbidden zones
ShowForbiddenArea = False # Set to True to visualize forbidden zonesWhen ShowForbiddenArea = True, the bot displays a semi-transparent overlay showing all forbidden zones in red. This is useful for:
- Debugging click position issues
- Visualizing protected UI areas
- Adjusting forbidden zone coordinates
IDLE_CLICK_POS = (2, 390) # Safe idle click position
STATS_UPGRADE_POS = (270, 304) # Stats upgrade button
SCROLL_START_POS = (170, 380) # Scroll start position
SCROLL_END_POS = (170, 200) # Scroll end positionForbidden zones prevent the bot from clicking on critical UI elements. Each zone is defined by X and Y coordinate boundaries:
# Zone 1: Right side menu area
FORBIDDEN_ZONE_1_X_MIN = 290
FORBIDDEN_ZONE_1_X_MAX = 350
FORBIDDEN_ZONE_1_Y_MIN = 93
FORBIDDEN_ZONE_1_Y_MAX = 270
# Zone 2: Left side top menu area
FORBIDDEN_ZONE_2_X_MIN = 0
FORBIDDEN_ZONE_2_X_MAX = 60
FORBIDDEN_ZONE_2_Y_MIN = 50
FORBIDDEN_ZONE_2_Y_MAX = 280
# ... and more zonesHow Forbidden Zones Work:
- Bot checks every click position before executing
- If position is inside any forbidden zone, click is blocked
- Prevents accidental UI interactions (settings, shop, ads, etc.)
Adding New Forbidden Zones:
- Set
ShowForbiddenArea = Trueto visualize current zones - Press X while hovering over the area you want to protect
- Note the coordinates shown in the log
- Add a new zone in
config.py:FORBIDDEN_ZONE_6_X_MIN = your_x_min FORBIDDEN_ZONE_6_X_MAX = your_x_max FORBIDDEN_ZONE_6_Y_MIN = your_y_min FORBIDDEN_ZONE_6_Y_MAX = your_y_max
- Update
mouse_controller.pyto include the new zone check - Update
bot.pyto include the zone in the overlay (if usingShowForbiddenArea)Press Z to start automation - Monitor the console and
logs/bot.logfor activity
All settings are in config.py. Key configurations:
WINDOW_TITLE = "SM-M315F" # Your scrcpy window title
WINDOW_WIDTH = 360 # Window width
WINDOW_HEIGHT = 780 # Window heightMATCH_THRESHOLD = 0.98 # General matching confidence (0.0-1.0)
RED_ICON_THRESHOLD = 0.95 # Red icon detection threshold
RED_ICON_MIN_MATCHES = 3 # Minimum template matches requiredIDLE_CLICK_POS = (2, 390) # Safe idle click position
STATS_UPGRADE_POS = (270, 304) # Stats upgrade button
SCROLL_START_POS = (170, 380) # Scroll start position
SCROLL_END_POS = (170, 200) # Scroll end positionConfigure areas where the bot should never click:
FORBIDDEN_ZONE_1_X_MIN = 290 # Right menu area
FORBIDDEN_ZONE_1_X_MAX = 350
FORBIDDEN_ZONE_1_Y_MIN = 93
FORBIDDEN_ZONE_1_Y_MAX = 260eatventure-bot/
├── main.py # Entry point, keyboard controls
├── bot.py # Core bot logic and state handlers
├── state_machine.py # State machine implementation
├── window_capture.py # Win32 window capture & forbidden zone overlay
├── image_matcher.py # OpenCV template matching
├── mouse_controller.py # Mouse automation with zone protection
├── telegram_notifier.py # Telegram notification system
├── config.py # Configuration settings (with detailed comments)
├── requirements.txt # Python dependencies
├── Assets/ # Template images (PNG)
├── logs/ # Log files
└── README.md # This file
The main configuration file with extensive comments explaining each setting:
- Window Configuration: WINDOW_TITLE and dimensions
- Telegram Settings: TELEGRAM_ENABLED, bot token, and chat ID
- Detection Thresholds: Template matching sensitivity
- Forbidden Zones: Protected UI areas (5 zones by default, expandable)
- Debug Options: ShowForbiddenArea for visual debugging
- Click Positions: All automated click coordinates
- Bot Behavior: Timing, delays, and automation parameters
- Ensure scrcpy is running
- Verify
WINDOW_TITLEinconfig.pymatches your scrcpy window exactly - Check window title with the X key while bot is running
- Try running:
scrcpy --window-title "YourDeviceName"with a custom title
- Verify template images are in
Assets/folder - Lower the threshold values in
config.py - Use X key to capture exact coordinates
- Ensure templates are clear PNG images with transparency if needed
- Enable
ShowForbiddenArea = Trueto visualize protected zones - Adjust click positions in
config.py - Configure additional forbidden zones to protect UI elements
- Review logs in
logs/bot.logfor coordinate information - Use X key to find correct coordinates
- Verify
TELEGRAM_ENABLED = Truein config.py - Double-check bot token and chat ID
- Test by visiting:
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates - Make sure you sent at least one message to your bot first
- Check logs for Telegram-related error messages
- Close unnecessary applications
- Ensure USB debugging is stable
- Reduce
CLICK_DELAYin config (current: 0.1s) - Check CPU usage during bot operation
- Consider lowering image matching thresholds
Logs are stored in logs/bot.log with detailed information:
- State transitions
- Template detection results
- Click coordinates
- Error messages
Set DEBUG = True in config.py for verbose logging.
- Forbidden Zone Protection: Prevents clicks in critical UI areas with configurable zones
- Visual Debugging: Optional overlay to visualize forbidden zones (
ShowForbiddenArea) - Window Activity Check: Stops if the game window closes
- Keyboard Interrupt: Clean shutdown with Ctrl+C or P key
- Smart Retry Logic: Automatic recovery from detection failures
- Telegram Monitoring: Real-time notifications to track bot activity remotely
This is a personal automation project. Feel free to fork and adapt it for your needs.
This bot is for educational purposes only. Use of automation tools may violate the game's Terms of Service. Use at your own risk.
MIT License - Feel free to use and modify as needed.
- OpenCV: Computer vision library
Intelligent automation bot for Eatventure mobile game
Keywords: Eatventure, Eatventure bot, game automation Python, OpenCV game bot, mobile game automation, Android game bot, scrcpy automation, computer vision gaming, Python game bot, automated gameplay, image recognition bot, restaurant game bot, idle game automation
- scrcpy: Android screen mirroring tool
- pywin32: Windows API access
Made with ❤️ for game automation enthusiasts