← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #222940]: Always miss when you click moving object

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
This is indeed a timing problem.

As an average, you can expect, that you get around 3 to 4 searches a
second with search areas not larger than about 300 x 300 pixels.

So the strategy to click a steadily moving object might be (supposing,
you have to search the whole screen the first time):

firstLoc = find(moving_object) # might take up to 1 sec
clickLoc = firstLoc.nearby(100).find(moving_object) # should be very fast
click(clickLoc) # good chance to hit it

There are some options for optimization, when knowing
- speed of movement in pixels/second
- direction of movement (north, north-east, east, ...)

The overall optimization strategy is to foresee the possible area, where
to find the moving object now.

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