← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #296402]: Best practice ?

 

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

RaiMan proposed the following answer:
--- but a bit slow when not finding the pattern
... that is because of the standard waiting time of 3 seconds.
There is a global, a region and a function setting to influence this waiting time. I prefer the function, because then it is more obvious:

if loc.exists("1468520600614.png", 0): doubleClick("1468520600614.png")

... the ,0 tells the search to give up after the first try, which should
let it come back after some 10 milliseconds with this rather small
region loc even in case it is not there.

this should be suitable for all the loc.exists().
the loc2.exists() should be left without the ,0, so it waits for the visual to appear, since I suppose, this only fires, if one of the doubleClicks before happened.

one more thing:
a region remembers the last match, so this is more convenient:
if loc.exists("1468520600614.png", 0): loc.doubleClick()
... in case of found, the center of the remembered match would be clicked without an additional search for what was already found just before.

If the resulting timing now is sufficient, then this is the easiest and
most straightforward solution.

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