Hi,
I am trying to do the following:
Search for an image inside a window (right now I can only search the entire desktop), and if it's found, do action 1.
Else If, search image 2, and if it's found, do action 2.
Else, do nothing.
Run the code every 60 minutes.
So far I have the following code:
#include <ImageSearch.au3>
$x1=0
$y1=0
$weaknessBar = _ImageSearch("C:\AutoIt\image1.bmp",1,$x1,$y1,0)
$strengthBar = _ImageSearch("C:\AutoIt\image2.bmp",1,$x1,$y1,0)
If $weaknessBar = 1 Then
MsgBox(0,"1","found image1")
ElseIf $strengthBar = 1 Then
MsgBox(0,"2","found image2")
Else
Sleep(3600000)
EndIf
The problem with this is that it searches the whole desktop and not inside a specific window.
I'm not sure if it's possible to search inside a window, but I couldn't implement _ImageSearchArea, either =/
Plus, how can I search multiple images? If I remove one of those variables the script runs fine, but I keep them both I get the following error:
C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3 (49) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Any help is much appreciated! Thank you very much