How to Install Macros in Logitech G HUB, Configure or Create Your Own
A comprehensive guide for setting up macros in Logitech G HUB
Using .lua scripts greatly extends what Logitech mice can do. These
macros for Logitech G HUB let you automate actions like recoil control in
Rust, CS 2, or PUBG. For instance, if you need
a Logitech recoil macro for CS2 or Rust, you can either buy a ready-to-go solution or create one yourself, then import it into G HUB.
Below is a step-by-step guide on how to make or install Logitech macros (ready-made or from scratch)
using the official Logitech G HUB software.
1. Downloading & Installing Logitech G HUB
Download G HUB from the Logitech website.
If you’re setting up macros on a Logitech G102 mouse (or any other G-series model like
G502, G402, G102, MX518, G900, G305, G403, G Pro, G603, G604, G703, G903) for the first time,
start with the latest stable version. If you encounter problems, try an older release
(e.g., 2021.10.8013 – Download G HUB (2021.10.8013)).
Install G HUB as Administrator.
This is crucial if you want Logitech mouse macros to compensate recoil in certain games,
since some games block scripts unless run with elevated privileges.
Running as administrator also prevents the common issue where macros work on the desktop but not in-game.
Make sure to DISABLE “on-board memory” mode. In newer G HUB versions, you can toggle it on the main screen (to the right of the mouse image).
2. How to Set Up a Macro on a Logitech Mouse
Have your .lua script ready. You can create one yourself or purchase a pre-made solution at Topmacro.net.
For example, if you plan on using Logitech G102 macros for Rust or PUBG, save the file to your desktop to easily find it during import.
Open G HUB and set the “Desktop” profile as your default (primary) profile.
Launch G HUB.
Go to “Games & Applications” or “Manage Profiles.”
Locate the “Desktop” profile and mark it as permanent (primary) in the profile’s details.
Always use the “Desktop” profile for scripts to avoid conflicts with specific game profiles.
3. Creating a Script and Importing a Lua Macro
Activate the “Desktop” profile.
This is the simplest way to test Logitech mouse macros,
as there are no limitations or conflicts with other game profiles.
Create a new script.
Look for a button labeled “Create New LUA Script” or something similar, and click it.
In the new window, go to “Script” → “Import” and choose your .lua file’s location.
This is particularly handy if you want to add multiple
lua macros for Logitech—say, for Rust, CS2, and other games.
Save and enable the script.
After importing, open the “Script” menu and select “Save and Run.”
This activates your macro so you can immediately see if it works as intended in G HUB.
4. Verifying Macro Functionality
Assign a button.
Our Logitech G102 macros (and those for other G-series models)
often default to a side button (like G5). You can change the button
either in the script itself or within G HUB.
Test on the Desktop profile.
Press or hold the assigned button. For example, if you installed a
Logitech macro for CS2 or Rust, check whether recoil is being compensated correctly.
If the cursor moves according to your script, you’re all set.
5. Adding Multiple Macros
If you need several different macros at once:
Repeat the steps above—create a new script and import the relevant .lua file.
Save and run each macro upon import.
Additionally, our site offers special Premium scripts that combine all weapon macros into one Lua script.
You can switch between macros using hotkeys on your keyboard or mouse.
6. Creating Your Own Macro in G HUB Logitech
If you want to build your own script from scratch, you’ll need at least some basic programming knowledge.
G HUB does include a built-in “Lua Scripting” interface with its own documentation,
so you can experiment and learn how to write your own macros step by step.
7. Macro Doesn’t Work in the Game
Ensure the “Desktop” profile is set as permanent in the profile’s details.
Completely close G HUB and relaunch it as Administrator.
Disable on-board memory mode if it’s on. Then reboot your PC.
If nothing helps, reinstall G HUB.
8. G HUB Won’t Start or Stays in Loading Loop
A reliable fix is to fully uninstall G HUB and install an older version, such as
2021.10.8013.
After installation, it may prompt you to update to a newer release—agree to that.
This method often restores stable performance.
9. Conclusion
Setting up macros for a Logitech mouse is typically straightforward if you follow the main steps:
Install G HUB using Administrator rights.
Select the “Desktop” profile as the main profile.
Create a new script (aka Logitech G HUB macro) and import your .lua file.
Save and run the macro to activate it.
We wish you productive work sessions and smooth gaming!