Need help with loop script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kryptooo
Posts: 9
Joined: 22 Oct 2018, 15:48

Need help with loop script

22 Oct 2018, 15:58

Hello

This is basically what i want it to do;
I push (and let go) joystickbtn_15 once
it toggles Q, and Q is raptly repeated for 1000 ms
than it pause it for 500 ms
and Q is held down and repeated for another 1000 ms
and than it breaks once joystickbtn_15 is pushed again.

Code: Select all

while getkeystate("Joy15", "p")
{
send {q down},
sleep, 45
send {q up},
}
}
return
Pls help im lost ;)
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Need help with loop script

23 Oct 2018, 09:12

Hi,

What does currently happen in your script?
Where exactly is the problem?
And you should start the script with Joy15 + adding some tabs (to make it better readable).

Something like this:

Code: Select all

Joy15::
while GetKeyState("Joy15", "P")
{
  Send {q down}
  Sleep, 45
  Send {q up}
}
return
P.S: I can't test it.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: WAZAAAAA and 403 guests