PhasmoBot
An automation bot for Phasmophobia that handles the repetitive parts of speedrunning the game. It uses screen capture and image recognition to detect what is happening on screen.
The Challenge
Detecting the main menu, map selection, loading states, and handling navigation securely through repetitive clicking using python GUI automation modules without failing randomly due to visual inconsistencies.
My Solution
Implemented robust computer vision using OpenCV template matching combined with pydirectinput for simulated keypresses directly hooked into the Windows message queue.
Tech Stack
- Python: It was an ideal choice for rapid prototyping and for the available image processing libraries.
- OpenCV: The key element of the project, this library provided the real-time image recognition capabilities with which the bot 'sees' the game.
- pydirectinput: Enabled low-level input simulation, which worked more reliably with games than the traditional `pyautogui`.
Technical Deep-Dive
Built entirely in Python 3. The process runs an infinite loop measuring screen chunks per second, computing template match thresholds, and jumping states inside a state machine.