Tested as working with this image. It will look for all of the red stars, capture a rectangle to the right of each star, and look for the green rectangle to the right of each star.
You may need to edit the tolerances (pay careful attention to the permitted values - they are different for EXACT and CCOEFF), and you will need to edit the offsets. Image_1 is the red star and Image_2 is the green rectangle.
Code: Select all
//Find Middle Right of
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0,8,XArr,YArr,NumFound,EXACT
let>k=0
repeat>k
Let>xpos=XArr_%k%
Let>ypos=YArr_%k%
//Edit these offets
Let>top=ypos-55
Let>bottom=ypos+55
Let>right=xpos+400
screencapture>xpos,top,right,bottom,%TEMP_DIR%\screenrect.bmp
//executefile>%TEMP_DIR%\screenrect.bmp
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_3.bmp,%TEMP_DIR%\screenrect.bmp,0.7,1,XArr2,YArr2,NumFound2,CCOEFF
If>NumFound2>0
MouseMove>{%XArr2_0%+%xpos%},{%YArr2_0%+%top%}
LClick
Endif
wait>1
let>k=k+1
Until>k,NumFound