← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #217842]: Going outside the loop to fail a find

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
even more simplified ;-)

a = find(pic1)
a1 = capture(a)
b = find (pic2)
b1 = capture(b)

while true:
  click(b)
  click(a)

*** comments
-- a1 is the same as pic1
-- b1 is the same as pic2
Because capture() captures exactly the match region, where the pic's are found

-- continue:
the trailing colon is wrong
-- this continue is useless (at least here), since we will continue with click(a) anyway after click(b) 

This should work, if pic1 AND pic2 are visible on the screen when the
find()'s are processed:

a = find(pic1)
b = find (pic2)
while true:
  click(b)
  click(a)

but it will simply click forever at the centers of the regions a and b,
no matter wether the pic's are still visible or not (the find()'s are
not repeated!)

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