Timer controlled input in loop

Get help with using AutoHotkey and its commands and hotkeys
bloxi10
Posts: 2
Joined: 20 Jun 2018, 09:28

Timer controlled input in loop

20 Jun 2018, 10:31

Hi,

Im trying to make a macro which continuously sends an input while a key is pressed in my case "Z", and repeatedly sends the input X. This is easily done but what I want to do now is have another key "U" be input at every 1000ms and Im confused on how to do this second part. I tried another approach instead of continuous input of X, having just 2 inputs exactly when I need them and then sending U, but I don't fully understand how this loop is working. Because the behaviour currently is - while "Z" is pressed it continuously sends "X" and once "Z" is unpressed it then sends the remaining keys i.e. "X" then "U".

The behaviour I want is either Continuous input of "X" and one "U" every 1000ms whilst "Z" is pressed, OR one "X" followed by another "X" 500ms later followed by one "U" and these 3 inputs repeated whilst "Z" is pressed.

This is what I had when i tried the second approach -

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Any help would be appreciated.
Rohwedder
Posts: 1287
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Timer controlled input in loop

20 Jun 2018, 11:17

Hallo;
perhaps:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Hellbent
Posts: 143
Joined: 23 Sep 2017, 13:34

Re: Timer controlled input in loop

20 Jun 2018, 11:42

Here are two different metods



Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

bloxi10
Posts: 2
Joined: 20 Jun 2018, 09:28

Re: Timer controlled input in loop

20 Jun 2018, 12:45

Thanks, SetTimer is what I was looking for.

Return to “Ask For Help”

Who is online

Users browsing this forum: lazynoob and 77 guests