How to abort macro's - Logitech Gaming

  • I'm already for a long time owner of logitech keyboards and mouses but to be honest I used their features quite rarely. From time to time i created macros for the G-Keys of my previous G15 but it never worked out so well. As my Logitech G15 keyboard were already over 10 years old and my Logitech G5 mouse had a break in the cable, my girlfriend were so nice to spend me a new Logitech G613 wireless keyboard and a Logitech G603 wireless Mouse to my birthday last year <3


    Today I finally had some things I wanted to put on the G-Keys. One key got an assignment to mute my microphone and the other should get a macro to buff my character in the old MMORPG I started playing again :) This worked very nice but there was a problem! Once the macro started, I couldn't abort it and the enemy had enough time to kick my ass^^ After some Googling and some short playing around I got my solution and that's what I want to share with you now :) (finally eh :D)


    To be able to abort the macro you have to modify the lua script of your current profile to start or stop the macro programmatically. Don't be afraid if you have no idea of programming, it's not that tricky this time :)


    Steps

    1. Open Logitech Gaming Software and navigate to the G-Key Modification


    2. For the macro's you want to be able to abort, remove the G-Key assignments by dragging the macro into the trash bin. In my case it is G5 with the Macro "Buff"




    3. Modify the script of your active profile (I bet in English the menu entry is called something like "Create Script"


    4. Insert the lua script

    Copy the following script and replace the content of the default script. If you have an own script you have to merge the code manually :)

    Once the script is in the editor you have to add the key-macro assignment at line 7. For each assignment create a like like macros[5] = "Buff" which means G5 holds the macro "Buff".

    When you have defined the assignment save the script and try it by pressing your G-Keys. The log below the editor should tell you what the script is doing :)




    I hope that helps some people and please feel free to give me feedback on the blog post or the script itself :)

Share

Comments 12

  • Are you still there?
  • So, i copied the Script. I've changed the relevant parts of your script from your [Macro5] to mine [Macro1], where i want it to be. Then theres the red error bar (Bug bar?) showing up.
    Here's a link to the screenshot i took: imgur.com/a/DajRmXo
    How can i fix this? Thanks for helping in advance.
    • Is there any error message in the field visible or when you hover with the mouse over the line? I may can check that on the weekend.
    • It only says "Syntax Error" in line 11
    • Ok I found the issue in your script. Line 11 has the parameter with the name '1' That is not valid. Please check against the script I posted. The parameter is key and it is used like 'macros[key]' and not like in your version 'macros1'. The script also mentioned to don't touch the area below :) Please again copy the script I posted and only change line 7 to 'macros[1] = "AutoSprint"' (without ')
    • So, i tried. But still it doesn't work like it should. As you said, i only changed the upper line and didn't change the lines underneath. In testing, there were no reactions to it. Did i do something wrong in changing your "Macros[5]" in my "Macros[1]"? What should i do?
    • Can you please show me the current script? Does the Macro with the name you used after macros[1] = "MACRONAME" already exist?
      I hope that you didn't used upper case Macros[1] but macros[1] :)