← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #664345]: CPU usage going through the roof when running script

 

Question #664345 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664345

    Status: Open => Answered

RaiMan proposed the following answer:
see comment #7

--- Also in these specific lines is a relatively high Target Offset included.
... does not matter for the search, since only applied to the match

reg1 = Region(2804,219,332,161) 
if reg1.exists(Pattern("hero.png").targetOffset(-202,247), 0.1): 
    reg1.click() # clicks what was found with exists() before

your solution
    if Region(2804,219,332,161).exists(Pattern("hero.png").targetOffset(-202,247), 0.1): Region(2804,219,332,161).click(Pattern("hero.png").targetOffset(-202,247))

leads to another search with the click, and apparently the image is no
longer visible (FindFailed)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.