Loop Not running

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Phasecoder
Posts: 7
Joined: 19 Sep 2017, 12:27

Loop Not running

22 Sep 2017, 11:39

I hav serperate include for MouseMovepoint so just change to mousemove

but why does this not execute at all

Code: Select all

Numpad0::
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 10, 94, 1032, 776, C:\Users\home\AppData\Roaming\MacroCreator\Screenshots\Screen_20170922172311.png
If ErrorLevel = 0
Loop
{
MsgBox, 49, Continue?, Image / Pixel Found at %FoundX%x%FoundY%.`nPress OK to continue.
IfMsgBox, Cancel
	Return
	if Errorlevel =1
	{
		;MoveMousePoint(629, 171, 7)
    MoveMousePoint(636, 182, 7)
    Sleep, 350
   click
   Sleep, 350
   return
}
}
Phasecoder
Posts: 7
Joined: 19 Sep 2017, 12:27

Re: Loop Not running

22 Sep 2017, 11:44

if I put it like this is dopesnt loop it I need to keep my numpad held in

Code: Select all

Numpad0::
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 10, 94, 1032, 776, C:\Users\home\AppData\Roaming\MacroCreator\Screenshots\Screen_20170922172311.png
If ErrorLevel = 0
Loop
{
MsgBox, 49, Continue?, Image / Pixel Found at %FoundX%x%FoundY%.`nPress OK to continue.
IfMsgBox, Cancel
	Return
} else
	if Errorlevel =1
	{
		;MoveMousePoint(629, 171, 7)
    MoveMousePoint(636, 182, 7)
    Sleep, 350
   click
   Sleep, 350
   return

}
mast4rwang
Posts: 141
Joined: 19 Jul 2017, 09:59

Re: Loop Not running

22 Sep 2017, 15:12

You put "return" inside a loop. If it moves your mouse pointer it returns and you need to press the button again(I guess :D)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Rohwedder and 240 guests