Universal customizable USM macro

USM (Universal Stage Macro) is a special macro that lets you significantly reduce recoil on any automatic weapon in a game, in several controlled stages.

Macro format

USM is a Lua program made specifically for Logitech G HUB, and all you need is a Logitech mouse with G HUB support: any mouse supported by the latest version of G HUB will do.

Settings for macros

There are no special game settings requirements: when you start tuning the USM macro for a weapon, you tune it for the game settings that are comfortable for you.

The STAGE concept and macro controls

The STAGE concept, or staged concept, unlike simple universal macros, offers a more flexible approach to changing recoil:

STAGE variables in a Logitech G HUB script

Default starting values for the spray stages

It’s much simpler than it looks, and it works for most automatic weapons in different games.

As you can see, the program has 3 stages: STAGE_1, STAGE_2 and STAGE_3, which are essentially 3 universal macros running one after another.

STAGE_N_TIME

STAGE_N_TIME is the duration of one specific stage N in milliseconds (1/1000 of a second). When all three stages are used, the whole spray of the weapon (TOTAL SPRAY TIME) must be fired within STAGE_1_TIME plus STAGE_2_TIME plus STAGE_3_TIME.

When you change the duration of any stage on the fly (right ALT, CTRL or SHIFT + mouse button 4 or 5), the G HUB script console automatically shows TOTAL SPRAY TIME at the very bottom. Its value is also shown when you call the Show Settings function (Right SHIFT + Mouse Button 3):

TOTAL SPRAY TIME in the G HUB script console

TOTAL SPRAY TIME shown when STAGE TIME is changed on the fly.

TOTAL SPRAY TIME via Show Settings in the G HUB script console

TOTAL SPRAY TIME shown by the Show Settings function.

STAGE_N_STEP

STAGE_N_STEP is the step: the time in milliseconds between crosshair movements by STAGE_N_X and STAGE_N_Y to compensate for recoil. The lower the value, the more often the movements happen, and vice versa. Ideally, pick it so that you use the smallest STAGE_N_X and STAGE_N_Y values and so that the matching STAGE_N_TIME divides by its STAGE_N_STEP with no remainder.

STAGE_N_X and STAGE_N_Y

STAGE_N_X and STAGE_N_Y are the values the crosshair moves by in stage N on the X axis (horizontal movement) and the Y axis (vertical movement). The lower the value, the shorter the distance the crosshair moves on that axis. Positive Y values move the crosshair down, positive X values move it to the right.

Spray duration in different games

To get TOTAL SPRAY TIME, which you need to work out how long the macro runs in any game and on any automatic weapon, you can use the following method.

Set STAGE_1_TIME to your estimated TOTAL SPRAY TIME, and set STAGE_2_TIME and STAGE_3_TIME to “0”. Then, if the spray fires the whole magazine (if not, increase STAGE_1_TIME), lower STAGE_1_TIME by 10–20 ms until one round is left in the magazine after a full spray with the macro. Then go back one step, to when the macro fired the full magazine: that’s the full spray time.

A small hint

Depending on the game, the fire rate of automatic weapons like the AK47 and M4 is usually around 85–110 ms per shot, and even less for submachine guns. The full spray time is easy to calculate: the number of rounds in the magazine minus one, multiplied by the time per shot in milliseconds.

For example, for an AK47 that fires a shot every 100 ms with a 30-round magazine, the calculation is:

Full spray time = (30 − 1) * 100 = 2900 ms

This is a great starting point for working out the spray duration of any weapon in any game. For some games and weapons we’ll provide exact TOTAL SPRAY TIME values and more.

Setting up the macro stages step by step

Of course, everything depends on the game, the weapon, your own recoil requirements and your imagination, but basically it comes down to a few options.

Step 1 (STAGE 1)

The recoil in the game is linear, and you want the functions of a standard linear macro, such as G.MACRO, tuned to your needs. One stage is enough for that, for example the first one: use STAGE_1 and set STAGE_2_TIME and STAGE_3_TIME to “0”; the other values of these stages are ignored in this case and can be anything. As a result, STAGE_1_TIME equals TOTAL SPRAY TIME.

USM macro STAGE 1

STAGE 1 TOTAL SPRAY TIME

Step 2 (STAGE 2)

You need this step if at some point of the spray the recoil still pulls down or up (left or right).

You can find the point where the spray starts to drift every time with the method used above for the whole TOTAL SPRAY TIME, only this time look for the time in milliseconds up to which the spray was stable. That time is STAGE_1_TIME, with the STAGE_1_STEP, STAGE_1_X and STAGE_1_Y values you already picked.

In this case STAGE_2_TIME equals TOTAL SPRAY TIME minus STAGE_1_TIME, STAGE_3_TIME equals “0” (the other STAGE_3 values are ignored in this case and can be anything), and STAGE_2_STEP, STAGE_2_X and STAGE_2_Y have to be picked based on how the recoil behaves.

For example, if at STAGE 2 the recoil starts to go up, make STAGE_2_Y larger than STAGE_1_Y, and if the recoil starts to pull to the right, make STAGE_2_X smaller than STAGE_1_X (if STAGE_1_X was “0”, use negative values).

USM macro STAGE 2

STAGE 1+2 TOTAL SPRAY TIME

Step 3 (STAGE 3)

This option works much like the previous one: if you find one more point where every spray drifts more in some direction, recalculate STAGE_2_TIME up to that point, and then calculate STAGE_3_TIME, which equals TOTAL SPRAY TIME minus STAGE_1_TIME minus STAGE_2_TIME. STAGE_3_X and STAGE_3_Y are picked the same way as STAGE_2_X and STAGE_2_Y in step 2.

USM macro STAGE 3

STAGE 1+2+3 TOTAL SPRAY TIME