Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

PixelSearch or ImageSearch resources

$
0
0
My script seems to be using a large amount of resources (CPU) while waiting to find the pixel or image designated, is there a more efficient way to accomplish my script without resources hogging?


#include <ImageSearch.au3>
$X1 = 0
$Y1 = 0
$X2 = 0
$Y2 = 0

While 1

$pixel = PixelSearch (440,368,491,475, 0xAD0000)
if IsArray ($pixel) = True Then
Sleep (750)
MouseMove($pixel [0], $pixel [1], 1)
MouseClick ( "left" )
Sleep (25)
Send ("{TAB}")
Sleep (25)
Send ("{TAB}")
Sleep (25)
Send ("{SPACE}")
Sleep (25)

Do
$adobeicon = _ImageSearch ('C:\COPY\adobeicon.bmp', 0, $x1, $y1, 20)
Sleep (750)
Until ($adobeicon) = True

Sleep (1000)

Send ("^p")
Sleep (750)

Send ("{ENTER}")

MouseMove($X1, $Y1, 1)
MouseClick ( "left" )

Do
$xbutton = _ImageSearch ('C:\COPY\xbutton.bmp', 0, $x2, $y2, 20)
Sleep (250)
Until ($xbutton) = True
Sleep (1000)
MouseMove($X2, $Y2, 1)

Sleep (250)
MouseClick ( "left" )

Else
if IsArray ($pixel) = False Then

EndIf
EndIf
WEnd


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>