Quote:
Originally Posted by alpines
Isolate your problem to a new script with the 10x10 white image.
Probably it's just a small error. Otherwise you can try to use PixelPattern which is slower but finds your image.
|
I have
Code:
#include <ImageSearch.au3>
Global $running = 0, $testx=0, $testy=0, $whitesquare=0
HotKeySet("{ESC}", "Terminate")
HotKeySet("{SPACE}", "togglerun")
Func Terminate()
Exit 0
EndFunc ;==>Terminate
Func togglerun()
If $running = 0 Then
$running = 1
TrayTip("", "Program Started", 3)
ElseIf $running = 1 Then
$running = 0
TrayTip("", "Program Paused", 3)
EndIf
EndFunc ;==>togglerun
While 1 = 1
While $running = 0
sleep(500)
WEnd
while $running = 1
local $whitesquare=0
$whitesquare = _ImageSearch("white.bmp", 1, $testx,$testy,200)
if $whitesquare = 1 Then
TrayTip("", "Image Found!", 3)
ElseIf $whitesquare = 0 Then
TrayTip("", "FAILED", 3)
EndIf
$running=0
WEnd
WEnd
To test my code yourself, just make a little bmp with whatever color you have on your desktop, and call it white.bmp . It fails every time
If this code works for you, please send me your ImageSearch.au3 and ImageSearchDLL.dll
As far as your second suggestion, did you mean this?
Thanks!