Page 1 of 1

Loop Not running

Posted: 22 Sep 2017, 11:39
by Phasecoder
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
}
}

Re: Loop Not running

Posted: 22 Sep 2017, 11:44
by Phasecoder
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

}

Re: Loop Not running

Posted: 22 Sep 2017, 15:12
by mast4rwang
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)