← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #272088]: onAppear with an array of images?

 

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

RaiMan proposed the following answer:
Uuups, crazy copy and paste ;-)

for ls in leftSide:
  r.onAppear(ls, moveLeft)
for rs in rightSide:
  r.onAppear(rs, moveRight)
for ns in neitherSide:
  r.onAppear(ns, moveRight)

Be aware:
Since currently in one observe processing step, all events are checked in sequence, this one step will last about 5 - 10 seconds (about 25 events each about 0.3 seconds).

To make it faster, the most recommended approach is to make the region
as small as possible.

Another possibility is to use a different Region object for each of the
image groups left, right and neither, since the observe then could be
run in background and would be delegated to 3 subprocesses.

rLeft = <someRegion>
for ls in leftSide:
  rLeft.onAppear(ls, moveLeft)
# same for left and neither

# run the observation
rLeft.observeInBackground(FOREVER)
# same for left and neither

# to keep the script alive
wait(FOREVER)

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