This is a 2D side scrolling game and I'm trying search for a chest image as it goes by. They are on random stages. I'm trying to search an area and click the image. Should be easy..
Code: Select all
ImageSearch, FoundX, FoundY, 0, 300, 800, 500, chest.png
If ErrorLevel = 1 ; If not Found
{
sleep 10
SoundBeep
}
else
{
If ErrorLevel = 0
Click, %FoundX%, %FoundY% ; Click on it.
sleep, 1000
}
Return
Thanks!