← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #187182]: Please help!

 

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).

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