Assign multiple Space pressing to F12

Ask gaming related questions (AHK v1.1 and older)
dagolard
Posts: 4
Joined: 22 Apr 2021, 01:12

Assign multiple Space pressing to F12

22 Apr 2021, 01:35

Hi all.

I'm not a big programmer. ;)

For crafting multiple Items in FO76 (Win 10) you have to "hammer" to space button. It's very incomfortable.

Now I want to assign the F12 button in game to press 100 times space with a 100...200ms delay. Will this work? How I can insert the delay? Need I additional commands to run it in the game (fullscreen)?

Code: Select all

:X*:F12::Send, {Space 100}
Thank you in Advance
User avatar
mikeyww
Posts: 26871
Joined: 09 Sep 2014, 18:38

Re: Assign multiple Space pressing to F12

22 Apr 2021, 05:10

Code: Select all

F12::
SetKeyDelay, 100
Send {Space 100}
Return
Sleep is an alternative to the key delay, which cannot be interrupted.

Explained: SetKeyDelay
dagolard
Posts: 4
Joined: 22 Apr 2021, 01:12

Re: Assign multiple Space pressing to F12

22 Apr 2021, 06:07

Great! Thank you. Additional question: If I want to interrupt this routine by pressing F12 a second time, what command I have to add?
User avatar
mikeyww
Posts: 26871
Joined: 09 Sep 2014, 18:38

Re: Assign multiple Space pressing to F12

22 Apr 2021, 07:03

Different question, different script.

Code: Select all

#MaxThreadsPerHotkey 2
F12::
on := !on
Loop, 100 {
 Send {Space}
 Sleep, 100 * on
} Until !on
on := False
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 76 guests