I'm trying to make working bot for android game (auto click bot on mobizen app).
Idea is pretty simple: start battle->check reward->if reward is good - keep it, if it s*cks - sell it for resources->repeat.
Everything is working perfect using exact match except part of checking reward - if i set exact match - macro can't find image on screen, if i set CCOEFF with any value below 1, f.g. 0.7-0.99 - macro click weird part of screen.
I attached example of image i need to find, part of it that defines is it good or not and what coordinate macro found it on screen.
Any help would be appreaciated - rest of images, f.g. start battle/ok/reward, etc. works good with exact match.
All images was captured using Image Capture Tool. Images are found on full screen mobizen window.
Whole script below:
Code: Select all
Label>WaitForAnImage
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\start.bmp,SCREEN,0,1,XArr,YArr,NumFound,EXACT
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
wait>0.1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\reward.bmp,SCREEN,0,1,XArr,YArr,NumFound,EXACT
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
wait>2
Lclick
Let>FoundAnImage=TRUE
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\4starlegendary.bmp,SCREEN,0,1,XArr,YArr,a1,EXACT
If>a1>0
FindImagePos>%BMP_DIR%\sell.bmp,SCREEN,0,1,XArr,YArr,b1,EXACT
If>b1>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\4starpurple.bmp,SCREEN,0,1,XArr,YArr,a2,EXACT
If>a2>0
FindImagePos>%BMP_DIR%\sell.bmp,SCREEN,0.7,1,XArr,YArr,b2,CCOEFF
If>b2>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\4starblue.bmp,SCREEN,0,1,XArr,YArr,a3,EXACT
If>a3>0
MouseMove>XArr_0,YArr_0
FindImagePos>%BMP_DIR%\sell.bmp,SCREEN,0.7,1,XArr,YArr,b3,CCOEFF
If>b3>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\5starblue.bmp,SCREEN,0,1,XArr,YArr,a4,EXACT
If>a4>0
FindImagePos>%BMP_DIR%\sell.bmp,SCREEN,0.7,1,XArr,YArr,b4,CCOEFF
If>b4>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\5starpurple.bmp,SCREEN,0,1,XArr,YArr,a5,EXACT
If>a5>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\sell.bmp,SCREEN,0.7,1,XArr,YArr,b5,CCOEFF
If>b5>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\5starlegendary.bmp,SCREEN,0,1,XArr,YArr,a6,EXACT
If>a6>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\get.bmp,SCREEN,0.7,1,XArr,YArr,b6,EXACT
If>b6>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\6starlegendary.bmp,SCREEN,0,1,XArr,YArr,a7,EXACT
If>a7>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\get.bmp,SCREEN,0,1,XArr,YArr,b7,EXACT
If>b7>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\6starpurple.bmp,SCREEN,0,1,XArr,YArr,a8,EXACT
If>a8>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\get.bmp,SCREEN,0,1,XArr,YArr,b8,EXACT
If>b8>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\6starblue.bmp,SCREEN,0.7,1,XArr,YArr,a9,CCOEFF
If>a9>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\get.bmp,SCREEN,0,1,XArr,YArr,b9,EXACT
If>b9>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\yes.bmp,SCREEN,0,1,XArr,YArr,NumFound,EXACT
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\unknown scroll.bmp,SCREEN,0,1,XArr,YArr,NumFound2,EXACT
If>NumFound2>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\ok.bmp,SCREEN,0,1,XArr,YArr,NumFound3,EXACT
If>NumFound3>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\mystical scroll.bmp,SCREEN,0,1,XArr,YArr,NumFound2a,EXACT
If>NumFound2a>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\ok.bmp,SCREEN,0,1,XArr,YArr,NumFound3a,EXACT
If>NumFound3a>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\rainbowmon.bmp,SCREEN,0,1,XArr,YArr,NumFound4,EXACT
If>NumFound4>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\ok.bmp,SCREEN,0.7,1,XArr,YArr,NumFound5,EXACT
If>NumFound5>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\shapeshiftstone.bmp,SCREEN,0,1,XArr,YArr,NumFound6,EXACT
If>NumFound6>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\ok.bmp,SCREEN,0,1,XArr,YArr,NumFound7,EXACT
If>NumFound7>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find FIRST image
FindImagePos>%BMP_DIR%\summoning stone.bmp,SCREEN,0,1,XArr,YArr,NumFound8,EXACT
If>NumFound8>0
//If FIRST image found, get position of image TWO and click on THAT
FindImagePos>%BMP_DIR%\ok.bmp,SCREEN,0,1,XArr,YArr,NumFound9,EXACT
If>NumFound9>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
Endif
wait>0.1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\replay.bmp,SCREEN,0,1,XArr,YArr,NumFound10,EXACT
If>NumFound10>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
wait>0.1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0,1,XArr,YArr,NumFound11,EXACT
If>NumFound11>0
MouseMove>XArr_0,YArr_0
LClick
Endif
wait>0.1
//Find and Do Nothing Center of
FindImagePos>%BMP_DIR%\image_2.bmp,SCREEN,0,1,XArr,YArr,NumFound12,EXACT
If>NumFound12>0
MouseMove>XArr_0,YArr_0
LClick
wait>3
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_3.bmp,SCREEN,0,1,XArr,YArr,NumFound13,EXACT
If>NumFound13>0
MouseMove>XArr_0,YArr_0
LClick
wait>2
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_4.bmp,SCREEN,0,1,XArr,YArr,NumFound14,EXACT
If>NumFound14>0
MouseMove>XArr_0,YArr_0
LClick
Let>FoundAnImage=TRUE
Endif
endif
Endif
If>FoundAnImage=FALSE
//Neither image was found, loop back and look again
Wait>0.2
Goto>WaitForAnImage
Endif
Label>WaitForAnImage
// do something here
Goto>WaitForAnImage