Learn more about CS2, Apex Legends and Rust with articles on the official ScriptsMonkey page! The best tutorials, tips and premium Lua macros and scripts listings
Logitech G Hub lets you import or write custom Lua scripts (macros) for your mouse or keyboard, automating everything from key combos to weapon recoil control. This Logitech G Hub tutorial walks you through the full setup – from installing the software to importing your macro file and assigning it to a button. We’ll keep it casual and clear, so even if you’re new to scripting, you’ll have your gaming macros ready in no time. Ready to level up? Let’s go! Disclaimer: This guide is for educational purposes only. Ensure any script usage complies with game policies to avoid penalties.
First, tweak G Hub’s basic settings so your scripts can run smoothly:
With G Hub open, click the lightning icon so “On-board Memory Mode” reads Off. This ensures your mouse uses G Hub (software) macros instead of its internal memory.
Streamline your DPI profiles (optional). If you have multiple DPI settings, consider keeping only one and locking it. This prevents any unexpected sensitivity changes while a macro is running. (The transcript suggests throwing away unused DPI stages to avoid confusion.)
Clear unused button assignments. Go to the Assignments tab for your device. For any keys/buttons you plan to use for macros, remove or disable existing assignments. This makes sure your script can take control of those buttons.
Focus on the Desktop profile. By default, G Hub creates game-specific profiles. For scripting, it’s best to use the “Desktop” profile only. Later we’ll make Desktop permanent, but for now just ensure you’re viewing the Desktop (default) profile in G Hub.
Logitech recommends using the Desktop profile for all scripts to avoid conflicts. This means G Hub will apply your macros across all games/apps, instead of tying them to one title.
Select the Desktop profile. In G Hub’s upper corner, click the profile dropdown and choose “Desktop: Default” (that’s your PC’s generic profile). Once selected, you’ll see it on your screen (see image below). Always use this profile when working with scripts.
In G Hub’s top-right, pick the “Desktop” profile (default). Using the Desktop profile for scripts avoids any game-specific conflicts.
Make Desktop profile permanent. To lock in the Desktop profile, click Details under the Desktop profile and then click “Make Permanent” (or “Set as persistent”). The menu will indicate the profile is now fixed (see image below). This ensures G Hub won’t switch profiles on its own, and your macros stay active whenever G Hub is running.
In the Desktop profile’s settings, click Make Permanent (highlighted above). The profile will say “Permanent” or show a lock icon. This locks G Hub to use Desktop by default.
Save your settings. After this, close any extra profile menus. Your G Hub is now primed: only one DPI stage, unwanted keys freed up, and Desktop set as the default permanent profile.
Now for the fun part – adding your macro script into G Hub:
Open the Scripting menu. In G Hub, click on your device (mouse) icon, then look for a Scripting or Macros section. Click “Create a new Lua script”. (G Hub’s interface might say something like “Create New LUA Script”.)
_Click Create Script (or “+”) on the Desktop profile. This opens the Lua scripting interface.
Import or paste your .lua script. Once the scripting window appears, go to the Script menu at the top and choose “Import” or “Edit > Paste.” Browse to where you saved your .lua macro file and open it. Your code will load into G Hub.
Save and run the script. After that, go back to the Script menu and select “Save and Run.” This activates the macro immediately. G Hub will compile the code and start the script engine. You should see the script listed as enabled now.
Name and organize. Give the script a clear name (like “AK-47 Recoil Compensation”) so you remember what it does. You can also create multiple scripts by repeating this process if you want several macros available.
If something isn’t working, don’t worry – common fixes can help:
If you see error messages in the Scripting window, double-check the Lua code. And remember, always test safely.
There you have it – a complete Logitech G Hub scripting guide for gamers. By now you’ve installed G Hub, turned off onboard memory, locked in your Desktop profile, and imported your first Lua macro. You’ve assigned it to a mouse button and seen it in action. Now you’re ready to create or download more gaming macros, automate complex moves, and elevate your play. Just be sure to use scripts responsibly and stay within any game’s rules. Enjoy your new Logitech macro setup, and happy gaming!