So I have 5 different images, if it comes up image 1 it should hit f1 any of the other images it should hit f2. I cant seem to get things right so here is my latest attempt.
Code: Select all
F7::
send, {f1}
sleep, 70-140
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 %A_ScriptDir%\Pix\Water.png
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else
send, {f2}
sleep, 100-150
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 %A_ScriptDir%\Pix\Fertilize.png
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else
send, {f2}
sleep, 100-150
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 %A_ScriptDir%\Pix\Pick.png
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else
send, {f2}
sleep, 100-150
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 %A_ScriptDir%\Pix\Harvest.png
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else
send, {f2}
sleep, 100-150