gitmyhub

FH6Auto-Fork

Python ★ 31 updated 13d ago

A Windows automation tool for Forza Horizon 6 that watches the game screen using image recognition and sends keyboard and mouse inputs to run races, buy cars, and grind skill points automatically without any manual input.

PythonOpenCVsetup: moderatecomplexity 2/5

FH6Auto Fork is an automation tool for the game Forza Horizon 6, written in Python with a README in Chinese. It is a fork (a personal copy with modifications) of an upstream project of the same name. The tool watches the game screen using image recognition and then sends keyboard and mouse inputs to carry out repetitive tasks automatically, letting the user run the game unattended for extended periods.

The tool has three main modules that can be run individually or chained together. The first handles repeated race runs: it automatically opens menus, navigates to EventLab, enters a blueprint code to select a specific race route, picks the correct car, and starts the race again and again for a set number of repetitions. The second module handles bulk car purchasing by navigating to the car collection, finding a target brand, selecting a specific model, and buying it repeatedly. The third module handles a skill point and reward mechanic in the game's upgrade system, automatically navigating through menus and clicking skill nodes in a path the user defines through a direction grid in the interface. All three modules can be linked into a single pipeline that cycles through racing, buying, and skill grinding in sequence and then loops back to the start.

The tool uses screenshot comparison rather than fixed screen coordinates to decide what to do next. It takes a screenshot, checks whether the game is showing the expected menu or page by matching template images, and only proceeds if the right state is detected. This approach is intended to make the tool more reliable than scripts that blindly send keystrokes in a fixed sequence. If the game crashes or the screen shows something unexpected, the tool tries to detect the problem, bring the game window back into focus, navigate back to a known menu state, and resume from where it stopped. An optional auto-restart feature can relaunch the game and resume the script if the game process disappears entirely.

The tool runs on Windows only and includes adjustments for high-DPI displays. The template images used for screen matching can be replaced by the user to handle different resolutions, graphics settings, or display configurations. The F8 key acts as an emergency stop at any time.

Where it fits