Old School RuneScape Computer Vision Bot
A Python and OpenCV bot for Old School RuneScape. It captures the game client from the Windows desktop, runs a cascade classifier I trained on 200+ positive and 1,000+ negative samples, and converts detections into mouse actions — a complete capture → detect → act loop. I built it as a learning project because game botting gives computer vision instant feedback: the detector either finds the target on screen or it doesn't.
How it works
WindowCaptureuses Win32 APIs to find the game window, crop the title bar and borders, and hand OpenCV clean frames.- A custom cascade classifier — trained with OpenCV's command-line tools on 200+ positive and 1,000+ negative samples — detects targets in each frame.
Vision.draw_rectangles()overlays detections in real time so I can watch exactly what the model sees.Vision.get_click_points()converts detection rectangles into center coordinates, and PyAutoGUI moves the mouse and clicks.- Capture, detection, and action run in a multi-threaded pipeline so screen grabs don't block the detector.
- The README documents the full cascade retraining workflow, so the model can be rebuilt from new samples.
Stack: Python, OpenCV, NumPy, PyWin32, PyAutoGUI.
What I'd improve
Detection quality is currently verified by eye, not by measurement. Next: unit tests for the rectangle-to-click-point math and capture offsets, a reviewed image batch for repeatable detection-quality checks, timing instrumentation on the detection loop, and a config file to replace the hard-coded window title.
Code is on GitHub.