gitmyhub

FH6Auto

Python ★ 278 updated 1d ago

Forza Horizon 6 Automation Tool / Super Wheelspin

A Python automation tool for Forza Horizon 6 on Windows that uses image recognition to run races, buy cars, and spend skill points on repeat, fully unattended, with error recovery and an emergency stop hotkey.

PythonOpenCVpyautoguipydirectinputcustomtkintersetup: moderate

FH6Auto is a Python automation tool for the racing game Forza Horizon 6. It is written in Chinese and designed for Windows. Rather than using fixed screen coordinates and blindly pressing keys, it takes screenshots of the game and uses image recognition to figure out what state the game is in before deciding what to do next. This makes it more reliable than simple macro scripts that can get stuck if any single step goes wrong.

The tool has three main modules that can be run individually or chained together. The first runs races in a loop using a specified blueprint code, which is a shareable race configuration inside the game. The second buys cars repeatedly from the in-game car showroom. The third spends skill points on a target vehicle to trigger the super wheelspin reward system. When all three are chained and set to loop, the tool runs unattended for extended periods: race for credits, buy a car, spend its skill points for spins, then start over.

Each module includes error recovery. If the image recognition fails to find an expected screen element, the script checks whether the game is still running, brings the game window back into focus, and tries to return to a known menu state before resuming. There is also an optional auto-restart setting that will relaunch the game executable if the process disappears and then wait for the welcome screen before continuing.

The image templates used for recognition can be replaced by the user. The tool loads images from a folder next to the program first, falling back to built-in defaults if no custom images are found. This lets users adapt the tool to different screen resolutions or graphics settings by swapping in their own screenshots of the relevant interface elements.

The project uses OpenCV for template matching, pyautogui and pydirectinput for keyboard and mouse simulation, and customtkinter for the desktop interface. An F8 hotkey provides an emergency stop that also releases any keys that may be held down at the time.

Where it fits