Clash of Clans OpenCV Bot

Bot successfully detecting a match

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.

Bot handling a failed detection case

Live Demo

🎥   Video coming soon — live footage of the bot in action will be added here.

Coming Soon