Re: [Sikuli-driver] [Question #252546]: Script Stopping
Question #252546 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252546 Jonas Maurer proposed the following answer: use match = exists(image.png) if match: click(match) this code will search for the image, and if found, click on it's location immediately without searching twice. (do not use exceptions to solve this. It is very bad practice.) -- You received this question notification because you are a member of Sikuli Drivers, which 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 #252546]: Script Stopping
Question #252546 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252546 Status: Open = Answered Eugene S proposed the following answer: Hi, Just 2 comments about the proposed solution: 1. If you are using Sikuli 1.0.1, you might not be able to use FindFailed exception straight away (see bug#1216338). As a workaround, add the following line to your code: import org.sikuli.script.FindFailed as FindFailed 2. To make your script run faster, use the approach offered by RaiMan to avoid unnecessary waiting for not existing imagesby using 0 parameter for wait and exist functions. As a result your code might look something like this: import org.sikuli.script.FindFailed as FindFailed try: wait(image, 0) print (Image %s found ) %(image) except FindFailed: print (Image %s NOT found) Eugene -- You received this question notification because you are a member of Sikuli Drivers, which 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
[Sikuli-driver] [Question #252546]: Script Stopping
New question #252546 on Sikuli: https://answers.launchpad.net/sikuli/+question/252546 I have a script similar to this if exists(image.png) click(image.png) The issue is that the image im searching for sometimes disappears inbetween those two lines of code. The script cannot click on it fast enough and stops running. How can I either make the mouse react faster or make it not quit the script if its unable to click on the image? -- You received this question notification because you are a member of Sikuli Drivers, which 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 #252546]: Script Stopping
Question #252546 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252546 Status: Open = Answered Mark Weisler proposed the following answer: On Aug 2, 2014, at 5:32 PM, Smizzy wrote: New question #252546 on Sikuli: https://answers.launchpad.net/sikuli/+question/252546 I have a script similar to this if exists(image.png) click(image.png) The issue is that the image im searching for sometimes disappears inbetween those two lines of code. The script cannot click on it fast enough and stops running. How can I either make the mouse react faster or make it not quit the script if its unable to click on the image? -- You received this question notification because you are an answer contact for Sikuli. Please try it with this structure... # --- using exception handling # every not found in the try block will switch to the except block try: find(path-to-image) pass # it is there except FindFailed: pass # we miss it -- Mark Weisler PGP Key ID 68E462B6 PGP Key fingerprint 87D5 A77B FC47 3CC3 DFF0 586D 23FF F8B4 68E4 62B6 You received this question notification because you are a member of Sikuli Drivers, which 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 #252546]: Script Stopping
Question #252546 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252546 Status: Answered = Open Smizzy is still having a problem: Thanks for the fast reply! How would i incorporate the click(image.png) into that structure? And would this replace the exists(image.png) ? -- You received this question notification because you are a member of Sikuli Drivers, which 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