← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #260950]: If something exists in region one then find it region 2

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
If in a workflow like yours, where you are scanning some images that might already be visible and some are not and hence skipped in the moment, one uses exists() as you already did.
exists() has a second parameter (timeout/waittime) that you can set as 0, so Sikuli will only check once and come back in any case (found or not), instead of waiting the standard 3 seconds for the image to appear.
So in your exists() in the if statements you might use exists(image, 0).

One more thing: in versions of Sikuli up to 1.0.1, you get a second search in these cases with the click:
if exists("1421711209099.png"):
    click("1421711209099.png")

In version 1.0.1+ you can use
if exists("1421711209099.png"):
    click()

which would simply click the already found match (saving up to one
second).

Beginning with 1.1.0 there is another speed-up feature:
When the same image is searched again, Sikuli first looks in the place, where it was found before,  which cuts down the second+ search time to some milliseconds from some hundred milliseconds.

And generally (True for all versions of Sikuli): the smaller the
area/region an image is searched in, the shorter the search time.

All this can be found in the docs and in tons of examples here and in
the net.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.