← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #284587]: looping a script forever in Sikulix

 

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

    Status: Answered => Open

Drex is still having a problem:
wow thanks i have tried everything but couldnt get that to loop now i
see i was not even close it looks much cleaner now and it does loop, one
more issue i forgot to post the whole code theres a second part in the
end that may show up at any time when energy is depleted and this will
auto refill i couldnt figure out how to insert it into your looped
version it has to click 4 images if image 1 pops up at the end after
wait("1453202882292.png",20),click("1453202898972.png") is clicked then
go back to clicking
wait("1453202882292.png",20),click("1453202898972.png") and continue
this is how i managed to get that work using the multi code section in
the middle which i found online

Image1 = ("1454598106549.png")
Image2 = ()
class Multi():
    def __init__(self):
        self.Search()
    def Search(self):
        # Look when one of the two images appear. 
        while True: 
            print('Searching....')
            if exists("1454598167955.png"):
                print("1454598182139.png")
                click("1454598192421.png")
                # Break loop.
                break
            elif exists():
                print()
                click()
                # Break loop.
                break
            else:
                pass
# Run class 
Multi()
Image1 = ("1454598132644.png")
Image2 = ()
class Multi():
    def __init__(self):
        self.Search()
    def Search(self):
        # Look when one of the two images appear. 
        while True: 
            print('Searching....')
            if exists("1454598132644.png"):
                print("1454598132644.png")
                click("1454598132644.png")
                # Break loop.
                break
            elif exists():
                print()
                click()
                # Break loop.
                break
            else:
                pass
# Run class 
Multi()
Image1 = ("1454598106549.png")
Image2 = ()
class Multi():
    def __init__(self):
        self.Search()
    def Search(self):
        # Look when one of the two images appear. 
        while True: 
            print('Searching....')
            if exists("1454598106549.png"):
                print("1454598106549.png")
                click("1454598106549.png")
                # Break loop.
                break
            elif exists():
                print()
                click()
                # Break loop.
                break
            else:
                pass
# Run class 
Multi()
Image1 = ("1454598655650.png")
Image2 = ()
class Multi():
    def __init__(self):
        self.Search()
    def Search(self):
        # Look when one of the two images appear. 
        while True: 
            print('Searching....')
            if exists("1454598655650.png"):
                print("1454598655650.png")
                click("1454598655650.png")
                # Break loop.
                break
            elif exists():
                print()
                click()
                # Break loop.
                break
            else:
                pass
# Run class 
Multi()

thank you for the quick reply and help i have been at this for a week
now with no progress

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