[ autoit ]
#include HotKeySet("{PAUSE}", "checkForImage") HotKeySet("{DEL}", "Terminate") global $y = 0, $x = 0 Func checkForImage() while 1 mousemove(960,600,10) Local $search = _ImageSearch('FEM.bmp', 1, $x, $y, 0) I f $search = 1 Then MouseMove($x, $y, 10) sleep(2000) EndIf wend EndFunc while 1 sleep(200) WEnd Func Terminate() while 1 sleep(200) wend EndFunc
I want to add to this code and make it so that If $search returns 0 it continually searches for the image every 33ms for the next 2 seconds (time of the sleep after image is found) without having to repeat the code 60 times. Any help is much appreciated
I looked into using TimerInit and TimmerDiff but couldn't get it to act quite as i wanted.