Coding

Ask gaming related questions (AHK v1.1 and older)
Ge101
Posts: 2
Joined: 16 Oct 2017, 10:22

Coding

16 Oct 2017, 10:42

First time on this forum so sorry if this isn’t in the right place. I’m trying to get my ahk so that when I hold down the z key it will double click every .6 seconds and keep doing that until I let off the z key. Any help would be appreciated. Thank you
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Coding

16 Oct 2017, 13:50

Code: Select all

#SingleInstance, Force

z::
    While(GetKeyState("z", "P")) {
        Click, 2 ; Double-Click
        Sleep, 600 ; 0.6 Seconds
    }
return
Here's the relevant code as a function:

Code: Select all

#SingleInstance, Force
SetBatchLines, -1

x::
    ClickRepeat(1, 100)
return

z::
    ClickRepeat(2, 600)
return

ClickRepeat(ClickCount, Delay) {
    While(GetKeyState(A_ThisHotkey, "P")) {
        MouseClick, Left,,, % ClickCount
        Sleep, % Delay
    }
}
Ge101
Posts: 2
Joined: 16 Oct 2017, 10:22

Re: Coding

19 Oct 2017, 19:27

Thank you very much

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: joefiesta and 31 guests