Actually I am thinking of making 30 images for the script to look for. When my health is on 30 or below the script should press '5'
The pictures would look like this; http://imgur.com/a/AnNUJ (this is at 67% health - i just found it on google but I wanted to show you how the images would look like). In this example lets call the image '67.png'
Im very novice and cant code much... This is what ive came up with:
Code: Select all
image_name67=67.png
image_name30=30.png
image_name29=29.png
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %image_name67%
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %image_name30%
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %image_name29%
if ErrorLevel = 2
tooltip Could not conduct the search.
else if ErrorLevel = 1
tooltip Image could not be found on the screen.
else
{
press '5'
}
return