Re: [Sikuli-driver] [Question #403018]: Pass value from handler (on appear) to main script
Question #403018 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/403018 Status: Answered => Solved spyros-liakos confirmed that the question is solved: Im done!! Thank you!!! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #403018]: Pass value from handler (on appear) to main script
Question #403018 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/403018 Status: Open => Answered masuo proposed the following answer: My sample codes may help you. def handler(event): global count event.stopObserver() count = count + 1 msg = "count=%d" % count popup(msg) observe(FOREVER, background = True) onAppear("image.png",handler) observe(FOREVER, background = True) count = 0 while count < 10: popup("Dummy popup") stopObserver() -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #403018]: Pass value from handler (on appear) to main script
Question #403018 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/403018 Status: Needs information => Open spyros-liakos gave more information on the question: Thanks for replying..! I want to observe always for an error popup in the program i use. The error is a internet connection error. If this happen i know how to wait and solve it. But then i want the script to start from the begin.. For example i got this: def start(): click("start.png") def play(): click("play.png") def finish(): click("close.png") #begin the script for x in range(100) if error = True: finish() start() if error = True: finish() play() if error = True: finish() finish() #the observe always def handler(): error = True #some function to solve the error onAppear("error.png", handler) observe(FOREVER) while True: observe() My think is to have an "if" before every function and if value "error = True" will pass all functions and start from the begin of the loop. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #403018]: Pass value from handler (on appear) to main script
Question #403018 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/403018 Status: Open => Needs information masuo requested more information: Please explain what you want to do. You can use try-except if you want to catch errors while the script is running. if you want to debug your codes, the following codes work without error. myvar = 0 if myvar == 22: p5() else: p1() -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp