As can be seen in figure 1, normal scripts will hook your keyboard or mouse, and whenever the fire button is pressed (usually left click), the script will pull down in the opposite direction of the recoil, effectively reducing it. This method takes no input from the game. There are no sensors and no code injection.

From here, I attempted to take this a step farther, how can I detect which gun is being used in game? That way I can combine my recoil scripts into one and the user uses one smart reducer. I experimented with a few ways and even attempted to use machine learning for image recognition. I quickly realized that this was a very well defined problem. In the bottom right of the screen, the gun is always displayed with the name. Why not take a small screenshot of this every time, since we always know the location?

figure 2: A small screenshot we use to detect the Mozambique handgun

Now that we have a list of pictures to compare against, whenever the user presses E to pick up a gun, or scroll, to switch between gun, we signal a screenshot to take place. This screenshot is then compared against a database of images using Mean Squared Error.

figure 3: mean squared error equation

By using mean squared error in figure 3, we can find an error of pixels in the image. After some fine tuning, I decided any error < 500, is sufficient in determining that is the gun being equipped and in what position. The output looks something like this:

figure 4: ReduxAL output, detecting which gun is equipped

Finally, after putting this all together, we get a smart recoil reducer:

figure 5: Recoil reduction across multiple guns

ReduxAL is an open source repository that currently only works for 2 guns. I do not plan to develop much past this. I, however, am open to pull requests. Feel free to make changes and add guns for other people. The repo can be found here: https://github.com/josephp27/ReduxAL with instructions on how to use and add your own guns.

DISCLAIMER:

Although this is hard to detect, I cannot guarantee you will not get caught. I do NOT use this in game but only created it for fun. If you plan to use this in game, I am not responsible if you get banned.