← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #231142]: If , elif problem

 

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

RaiMan proposed the following answer:
One more thing:

When using exists(), one should always decide wether it is necessary for
the internal finding operation, to wait the default 3 seconds before
giving up and returning null (false).

In your case, if all tests fail, the try block will consume up to 20
seconds (6 * 3 secs + overhead).

So if all images should be on the screen shortly after the click, at least the second and following exists() should be used as:
elif exists(image, 0):

This lets the exists() return immediatly after the first search, which would be in average on the whole screen about 0.5 secs
In this case, the longest time will be 3 secs for the first and 3 secs for the rest together resulting in about 6 seconds total.

Be aware: the search time can even be reduced to values around 0.1 secs,
if you restrict the search area to the region, where you expect the
target and use reg.exists().

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