Help writing a simple ahk Topic is solved

Ask gaming related questions (AHK v1.1 and older)
User avatar
Wollad
Posts: 3
Joined: 06 Mar 2021, 20:20

Help writing a simple ahk

Post by Wollad » 20 Jul 2021, 00:00

Hello, i would be really thankfull if you could help me write a simple ahk.
So i need a ahk that will press escape button, wait 5 seconds then press escape button again, wait 42 minutes and then repeat.
If its possible activate/deactivate on F11 button, thanks.

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

Re: Help writing a simple ahk

Post by mikeyww » 20 Jul 2021, 06:46

Code: Select all

#MaxThreadsPerHotkey 2
F11::
on := !on
While on {
 Send {Esc}
 Loop, 5
  Sleep, 1000 * on
 Until !on
 Send % on ? "{Esc}" : ""
 Loop, % 60 * 42
  Sleep, 1000 * on
 Until !on
}
Return

User avatar
Wollad
Posts: 3
Joined: 06 Mar 2021, 20:20

Re: Help writing a simple ahk

Post by Wollad » 20 Jul 2021, 08:24

Thanks! But i have a problem, the game that im using this script for needs some time pressing buttons so could you add the
Send, {Esc down}
Sleep 15
Send, {Esc up}
thing please.

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

Re: Help writing a simple ahk  Topic is solved

Post by mikeyww » 20 Jul 2021, 08:29

At the top, you can issue something like SetKeyDelay,, 25.

Explained: SetKeyDelay

Post Reply

Return to “Gaming Help (v1)”