Making a key press at random times.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DeeepFriedWatrr
Posts: 2
Joined: 26 Jun 2022, 07:25

Making a key press at random times.

Post by DeeepFriedWatrr » 26 Jun 2022, 07:28

I need help making the 1 key press at random times between 1 and 30 seconds, thanks.

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

Re: Making a key press at random times.

Post by mikeyww » 26 Jun 2022, 08:36

Welcome to this AutoHotkey forum!

Code: Select all

Loop {
 Send 1
 Random rnd, 990, 29990
 Sleep, rnd
}

DeeepFriedWatrr
Posts: 2
Joined: 26 Jun 2022, 07:25

Re: Making a key press at random times.

Post by DeeepFriedWatrr » 26 Jun 2022, 08:44

Thanks for the help, if it isn't any trouble, is there a way I can make it press either !1, !2, !3, or !4? I want it to be a random choice

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

Re: Making a key press at random times.

Post by mikeyww » 26 Jun 2022, 09:08

Code: Select all

Loop {
 Random, key, 1, 4
 Send !%key%
 Random, rnd, 990, 29990
 Sleep, rnd
}
You can click on the posted commands to learn more about how they work.

Post Reply

Return to “Ask for Help (v1)”