← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268175]: Loop two different actions in Sikuli forever

 

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

    Status: Answered => Open

Hashtag123 is still having a problem:
Sorry for the late Answer. I finally found time to proceed my project and solved my problem.
Using absolut regions made the script pretty fast.

reg = Region()
while True:
    while True:
        if reg.exists(Pattern,0):
            type(Key.RIGHT)
            break
        else:
            type(Key.LEFT)
    while True:
        if reg.exists(Pattern,0):
            type(Key.LEFT)
            break
        else:
            type(Key.RIGHT)

I have one final task though. How Can I loop this script for a specific duration?
For examples 5 minutes.

I guess I need to replace

while True:

with some sort oft function.

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