← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #682734]: Unable to simultaneously listen to global hotkeys and do desktop surveillance

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
I guess a timing problem, because the loop steps are executed too fast:

assuming
- 1.png is found
- 1.png is clicked and starts to vanish
- loop repeats
- has(1.png) still sees 1.png
- but click(1.png) no longer finds it

so my suggestion:

waittime = 1.0

    if has(Pattern("1.png").similar(0.66)):
        click()
        wait(waittime)
    if has ("2.png"):
        click()
        wait(waittime)
        paste("email@xxxxxxxxx")
    if has ("3.png"):
        click()
        wait(waittime)
    if (exitScript):
        exit()

you might experiment with the waittime: 0.5 might be sufficient

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