How to hold F-keys and shift+key combination to spam

Ask gaming related questions (AHK v1.1 and older)
butterhead
Posts: 2
Joined: 28 Jun 2022, 17:19

How to hold F-keys and shift+key combination to spam

Post by butterhead » 28 Jun 2022, 17:56

Hello,

I have recently discovered Kripparian's Alternative To Button Mashing, which enabled me to play the game without developing finger rsi. Some guy in the comments posted one where I can add a key to hold->spam so i don't have to create 20 scripts for each of the keys. It works flawlessly with letters and number keys above them, but when it comes to the F1-F12 keys or combinations like Shift+t I am clueless about how to do that.

Code: Select all


~r::Hold_Down("r")
~t::Hold_Down("t")
~e::Hold_Down("e")
~y::Hold_Down("y")

Hold_Down(key) {
    loop
    {
        GetKeyState, ScrollLockState, ScrollLock, T

        if (ScrollLockState = "U") {
            break
        } else {
        send %key%
            Sleep, 40
        GetKeyState, state, %key%, P
        if state = U ;
            break
        }
    }
    return
}

[Mod edit: [code][/code] tags added.]

Can anyone help me incorporate those into this one or into the separate one?

User avatar
mikeyww
Posts: 26856
Joined: 09 Sep 2014, 18:38

Re: How to hold F-keys and shift+key combination to spam

Post by mikeyww » 28 Jun 2022, 19:38

Instead of Send %key%, you could try Send {%key%}. For a shifted key, you would do something like +{%key%}, depending on the rest of the code.

Reading some documentation can help you to understand the script and what to do next. I would start with :arrow: Send. It is one page.

butterhead
Posts: 2
Joined: 28 Jun 2022, 17:19

Re: How to hold F-keys and shift+key combination to spam

Post by butterhead » 29 Jun 2022, 06:18

thank you!!!!

Post Reply

Return to “Gaming Help (v1)”