← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #187182]: How to wait for and click on 4 buttons, that appear at different times

 

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

SteveElrad posted a new comment:
That is the coolest thing ever, it works great. I'm going to have to get
into it on a larger scale to see what else I can come up with.
Thanks a lot,

Steve Elrad



On Wed, Feb 8, 2012 at 8:40 AM, RaiMan <question187182@xxxxxxxxxxxxxxxxxxxxx
> wrote:

> Your question #187182 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/187182
>
>    Status: Open => Answered
>
> RaiMan proposed the following answer:
> quick and dirty:
>
> while True:
>    if exists(button1, 0): click(getLastMatch())
>    if exists(button2, 0): click(getLastMatch())
>    if exists(button3, 0): click(getLastMatch())
>    if exists(button4, 0): click(getLastMatch())
>    wait(3) # adjust this to your needs
>
> --- comment on exists(img,0)
> Usually the find operation behind such features like find(), click(),
> exists() wait 3 seconds (standard waiting time) for the visual object
> before giving up.
> The ,0 tells Sikuli to make only one search try, which on average takes
> about 0,5 seconds (or more depending on cpu speed)
>
> Since it is an infinite loop, you have to stop it using shift-alt-c on
> Windows.
>
> Have a look at the faq list ( https://answers.launchpad.net/sikuli/+faqs
> ), some entries might be valuable for your next steps.
>
> And there we have the docs: http://sikuli.org/docx/ (e.g. in the index
> you will find getLastMatch() and understand, what it is good for).
>
> One more thing:
> Currently you are searching the whole screen. Restricting the search to a
> smaller region speeds things up and make them more robust (faq 1607).
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/sikuli/+question/187182/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/sikuli/+question/187182
>
> You received this question notification because you asked the question.
>

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