Clash of Clans OpenCV Bot
What It Does
This bot uses Python and OpenCV to watch the Clash of Clans screen in real time, automatically detecting in-game events using computer vision template matching. It captures the screen, locates targets, and responds — all without any game modification.
The bot runs entirely through screen capture and image recognition, making it a pure computer vision project built on top of a live game environment.
How It Works
OpenCV's template matching scans each frame of the captured screen for known reference images — like buttons, troop icons, and UI elements. When a match is found above a confidence threshold, the bot triggers the appropriate action automatically.
Python's pyautogui handles mouse and keyboard input, while
mss provides fast screen capture to keep the loop running in real time.
Live Demo
Screenshots
Only a handful of screenshots are available right now — more will be added as the project grows.
Coming Soon
- Attack recognition — detect when your village is under attack
- Defense analysis — classify troop types and raid patterns
- Resource tracking — monitor loot availability automatically
- Live demo video of the bot running in real time
- More screenshots and annotated captures