iBLeftX and iBLeftY are the bottomleft x and y coordinate of the first image, the rest should be the same on your screen I guess, if not change the values.
iDistance: x and y distances between two images
iImage: width, height of images to capture (you just want the part below the numbers)
The script takes the bottom part of each image, then compares these images to one-other. If it twice fails, that's the right image.
I didn't think too much about the algo, you can probably optimize it, anyway, it works and it should give you some inspiration:
Code: Select all
Let>iBLeftX=592
Let>iBLeftY=365
Let>iDistanceX=100
Let>iDistanceY=102
Let>iImageX=47
Let>iImageY=14
Let>nImage=0
Let>nCount=0
ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%},{%iBLeftX%+%iImageX%},iBLeftY,c:\Temp\bmp1.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%},{%iBLeftX%+%iDistanceX%+%iImageX%},iBLeftY,c:\Temp\bmp2.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},iBLeftY,c:\Temp\bmp3.bmp
ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp4.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+%iDistanceX%+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp5.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp6.bmp
ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp7.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+%iDistanceX%+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp8.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp9.bmp
CompareBitmaps>C:\temp\bmp1.bmp,C:\temp\bmp2.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp1.bmp,C:\temp\bmp4.bmp,nMatch
if>nMatch<90
Message>It's Number 1!
endif
Endif
CompareBitmaps>C:\temp\bmp2.bmp,C:\temp\bmp3.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp2.bmp,C:\temp\bmp5.bmp,nMatch
if>nMatch<90
Message>It's Number 2!
endif
Endif
CompareBitmaps>C:\temp\bmp3.bmp,C:\temp\bmp4.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp3.bmp,C:\temp\bmp6.bmp,nMatch
if>nMatch<90
Message>It's Number 3!
endif
Endif
CompareBitmaps>C:\temp\bmp4.bmp,C:\temp\bmp5.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp4.bmp,C:\temp\bmp7.bmp,nMatch
if>nMatch<90
Message>It's Number 4!
endif
Endif
CompareBitmaps>C:\temp\bmp5.bmp,C:\temp\bmp6.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp5.bmp,C:\temp\bmp8.bmp,nMatch
if>nMatch<90
Message>It's Number 5!
endif
Endif
CompareBitmaps>C:\temp\bmp6.bmp,C:\temp\bmp7.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp6.bmp,C:\temp\bmp9.bmp,nMatch
if>nMatch<90
Message>It's Number 6!
endif
Endif
CompareBitmaps>C:\temp\bmp7.bmp,C:\temp\bmp8.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp7.bmp,C:\temp\bmp1.bmp,nMatch
if>nMatch<90
Message>It's Number 7!
endif
Endif
CompareBitmaps>C:\temp\bmp8.bmp,C:\temp\bmp9.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp8.bmp,C:\temp\bmp2.bmp,nMatch
if>nMatch<90
Message>It's Number 8!
endif
Endif
CompareBitmaps>C:\temp\bmp9.bmp,C:\temp\bmp1.bmp,nMatch
If>nMatch<90
CompareBitmaps>C:\temp\bmp9.bmp,C:\temp\bmp3.bmp,nMatch
if>nMatch<90
Message>It's Number 9!
endif
Endif