I'm trying to create a loop that does the following:
Compare the screen captured image of an area on the screen to later images of the same area.
If the images are similar enough then the loop counter would increase by 1.
If the images are not similar enough, the loop counter would start over at 0.
When the images were similar on say...20 consecutive iterations, the macro could move forward.
So, if %k% got to say...17 and then the images weren't the same, the counter (i.e. %k%) would go back to 0 and start over until the condition was satisfied 20 consecutive times.
Code: Select all
ScreenCapture>1168,755,1190,815,C:\MyDocuments\Image1.bmp
//...do some stuff...
//start the loop
Let>k=0
repeat>k
Let>k=k+1
ScreenCapture>1168,755,1190,815,C:\MyDocuments\Image2.bmp
wait>0.1
CompareBitmaps>C:\MyDocuments\Image1.bmp,C:\MyDocuments\Image2.bmp,nPercent
If>%nPercent%>90
wait 0.1
Add>k,1
Else
Let>k=0
EndIf
until>k=20
The usual problem I run into is that the counter runs 20 iterations regardless of whether the "if" condition has been satisfied or not.
Any help on this would be greatly appreciated!
Thanks!
R.J.