Macro question

Ask gaming related questions (AHK v1.1 and older)
3rne5t0
Posts: 48
Joined: 16 Jun 2018, 01:36

Macro question

01 May 2022, 02:30

Code: Select all

1::
While, GetKeyState("1","P") {
ImageSearch, X, Y, 27, 23, 115, 44, *20 Merc2.bmp
If (ErrorLevel == 0) {
	Send, {Shift Down}
sleep, 120
click, left
sleep, 120
Send, {Shift Up}
	}
else if (ErrorLevel ==1)
{
send, 1
}
sleep, 500
}
Return
Well the send 1 command not working because i block whit script how can i make this work that it can send 1 command bud when i press 1 its not automatic sending 1
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Macro question

01 May 2022, 06:57

You can display the ErrorLevel in the script, so that you know what the ErrorLevel is.

You want to send the same key as the hotkey itself. To avoid triggering a loop, use the dollar prefix.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 98 guests