← 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:
-- 1. latest version of SikuliX? at least 1.1.1? http://sikulix.com

-- 2. understood, how SikuliX works?
http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-how-does-it-find-images-on-the-screen

--3. reduce CPU usage
- reduce the search region to the minimum acceptable
- reduce the scanrate 

general recommendation: name your images.

instead of:
    if Screen(1).exists(Pattern("1516809781721.png").similar(0.90)):
        Screen(1).click(Pattern("1516809781721.png").similar(0.90))

use:
if regionOnScreen1.exists(image1, 0)): regionOnScreen1.click()

- searches only once, does not wait 3 seconds
- clicks what was found before in regionOnScreen1

Optimize your image shots:
- as little background to the edges as possible
- concentrate on the key differentiating aspects

Good shots are found with a score of 0.95+, so no need for
Pattern.similar

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