I need help setting a Macro Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RandomGuy123
Posts: 3
Joined: 05 Jul 2022, 21:20

I need help setting a Macro

Post by RandomGuy123 » 05 Jul 2022, 21:23

Hey guys,

I've recently been trying to set up a macro on my computer but I am struggling to get it work, I want this macro to hold down the control button for 5 seconds and during this time also press the space bar and left click simultaneously. I would really appreciate it if someone could help me figure out how to do it correctly. This is what I have so far:

Code: Select all

+j::
SendEvent,  {^Space down}{Click}
return

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

Re: I need help setting a Macro  Topic is solved

Post by mikeyww » 05 Jul 2022, 21:45

Welcome to this AutoHotkey forum!

Code: Select all

+j::
end := A_TickCount + 5000
Send {Ctrl down}
While (A_TickCount < end)
 Send {Space down}{LButton}{Space up}
Send {Ctrl up}
Return

RandomGuy123
Posts: 3
Joined: 05 Jul 2022, 21:20

Re: I need help setting a Macro

Post by RandomGuy123 » 05 Jul 2022, 21:56

Thank you very much for the fast reply and the script! I really appreciate it :)

RandomGuy123
Posts: 3
Joined: 05 Jul 2022, 21:20

Re: I need help setting a Macro

Post by RandomGuy123 » 05 Jul 2022, 22:09

mikeyww wrote:
05 Jul 2022, 21:45
Welcome to this AutoHotkey forum!

Code: Select all

+j::
end := A_TickCount + 5000
Send {Ctrl down}
While (A_TickCount < end)
 Send {Space down}{LButton}{Space up}
Send {Ctrl up}
Return
Sorry about this but one more thing, how I would make it so after sending the space down and left mouse button, there is 1.7 second delay between the next one going off. So it would go like hold down control, send space down and leftbutton down, then wait 1.7 seconds, then do it again. Thanks again for the previous reply

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

Re: I need help setting a Macro

Post by mikeyww » 05 Jul 2022, 22:27

Code: Select all

+j::
end := A_TickCount + 5000
Send {Ctrl down}
While (A_TickCount < end) {
 Send {Space down}{LButton down}
 Sleep, 1700
 Send {LButton up}{Space up}
}
Send {Ctrl up}
MsgBox, 64, Done, Done!
Return

Post Reply

Return to “Ask for Help (v1)”