I`m trying to write a code that does an image search loop until the image is not found.
Then it has to wait 4 seconds and send an imput.
Finally, It needs to go back to the image search loop, and there is where I fail.
The code i wrote is more or less like this:
Code: Select all
Type1:
Toggle:= !Toggle
If Toggle {
While Toggle {
ImageSearch, , , 0, 0, 1000, 90, *10 youimage.png
If ErrorLevel = 0
Var:= True
if ErrorLevel = 1
Var:= False
If (Var = False) {
SetTimer,Type1ImgSearch , -4000
}
Return
}
If !Toggle {
Return
}
Return
Type1ImgSearch:
SendInput, q
Return
}
Any help is much appreciated.
Thanks and kind regards.