[Sikuli-driver] [Question #259687]: UnicodeEncodeError when calling a script in some other script
New question #259687 on Sikuli: https://answers.launchpad.net/sikuli/+question/259687 I was facing an issue where I need to copy the text and compare. Now as I have overcome the issue, one another issue I am facing is while importing same script in another scripts. Below is my script. Can you please help me to resolve the issues as it raise WHILE IMPORTING!! Non-ASCII character in file ' D: test.sikuli\test.py', but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Script1: Test from sikuli import* import codecs compareValue = We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click “Switch Back.” def testnow(): getTitle = Region(find(1419429990021.png)) getTitle.highlight(2) getContent = Region(getTitle.x, getTitle.y+50, getTitle.w, getTitle.h) hover(getContent) for x in xrange(3): mouseDown(Button.LEFT) mouseUp() type(c, KEY_CTRL) gettext = Env.getClipboard().encode('utf-8') print Text: ,gettext if gettext == compareValue: print Pass else: print Fail testnow() Script2: Test1 from sikuli import* import codecs import test reload(test) -- 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 #259668]: onVanish() - Handler
Question #259668 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259668 Linked to bug: #1405749 https://bugs.launchpad.net/bugs/1405749 [1.1.0] onVanish handler is not processed -- 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 #259668]: onVanish() - Handler
Question #259668 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259668 Status: Open = Solved RaiMan changed the question status: taken as a bug -- 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] [Bug 1405749] [NEW] [1.1.0] onVanish handler is not processed
Public bug reported: Version: 1.1.0 2014-12-23_01:00nightly Language: Python OS X 10.8 Code: ### def myHandler(event): a = 1 reg.setROI(10,10,10,10) reg = Region(0,0,1400,800) a = 0 reg.onVanish(1419518759619.png, myHandler) reg.observe(background = False) reg.stopObserver() print a print reg.getX(), reg.getY(), reg.getW(), reg.getH() ### Question: Hey all! First, english isn't my native language, so sorry for my possible mistakes :( I'm trying to use onVanish() function, but it doesn't work. I wrote a little script to test it and my pattern that i used is a screenshoot file. First i open the screenshot, then i run the script with the IDE. It will be forever open if i don't do anything, but if i close the screenshot the script finishes, so i assume that onVanish() triggers correctly. But the result of the prints are: 0 0 0 1400 800 Although it triggers, it doesn't seem to call my handler. If i use onAppear() in this example the handler function will work correctly and will be called. Is it a bug? Or what am i doing wrong? Thanks :) ** Affects: sikuli Importance: Undecided Status: New -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1405749 Title: [1.1.0] onVanish handler is not processed Status in Sikuli: New Bug description: Version: 1.1.0 2014-12-23_01:00nightly Language: Python OS X 10.8 Code: ### def myHandler(event): a = 1 reg.setROI(10,10,10,10) reg = Region(0,0,1400,800) a = 0 reg.onVanish(1419518759619.png, myHandler) reg.observe(background = False) reg.stopObserver() print a print reg.getX(), reg.getY(), reg.getW(), reg.getH() ### Question: Hey all! First, english isn't my native language, so sorry for my possible mistakes :( I'm trying to use onVanish() function, but it doesn't work. I wrote a little script to test it and my pattern that i used is a screenshoot file. First i open the screenshot, then i run the script with the IDE. It will be forever open if i don't do anything, but if i close the screenshot the script finishes, so i assume that onVanish() triggers correctly. But the result of the prints are: 0 0 0 1400 800 Although it triggers, it doesn't seem to call my handler. If i use onAppear() in this example the handler function will work correctly and will be called. Is it a bug? Or what am i doing wrong? Thanks :) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1405749/+subscriptions ___ 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] [Bug 1405749] Re: [1.1.0] onVanish handler is not processed
I tested and have to admit: The event onVanish is recognized, but the handler is not visited. I have to further evaluate and fix it. -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1405749 Title: [1.1.0] onVanish handler is not processed Status in Sikuli: New Bug description: Version: 1.1.0 2014-12-23_01:00nightly Language: Python OS X 10.8 Code: ### def myHandler(event): a = 1 reg.setROI(10,10,10,10) reg = Region(0,0,1400,800) a = 0 reg.onVanish(1419518759619.png, myHandler) reg.observe(background = False) reg.stopObserver() print a print reg.getX(), reg.getY(), reg.getW(), reg.getH() ### Question: Hey all! First, english isn't my native language, so sorry for my possible mistakes :( I'm trying to use onVanish() function, but it doesn't work. I wrote a little script to test it and my pattern that i used is a screenshoot file. First i open the screenshot, then i run the script with the IDE. It will be forever open if i don't do anything, but if i close the screenshot the script finishes, so i assume that onVanish() triggers correctly. But the result of the prints are: 0 0 0 1400 800 Although it triggers, it doesn't seem to call my handler. If i use onAppear() in this example the handler function will work correctly and will be called. Is it a bug? Or what am i doing wrong? Thanks :) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1405749/+subscriptions ___ 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 #259459]: How to overcome the screen resolution issue or browser issues.
Question #259459 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259459 Status: Open = Answered RaiMan proposed the following answer: just to keep it open -- 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 #259687]: UnicodeEncodeError when calling a script in some other script
Question #259687 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259687 Status: Open = Answered RaiMan proposed the following answer: When importing a script from another script, all code on indent level 0 (not indented) is processed once. This is again done on reload. Since in your case the function call testnow() is on level 0, it is called on import and hence runs. Since it seems to produce an error, the irritating message is produced (and is a bug) If you use your import as usual, but call testnow() in the importing script, then you should get a better error evaluation. see comments Script1: Test from sikuli import* import codecs compareValue = We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click “Switch Back.” def testnow(): getTitle = Region(find(1419429990021.png)) getTitle.highlight(2) getContent = Region(getTitle.x, getTitle.y+50, getTitle.w, getTitle.h) hover(getContent) for x in xrange(3): mouseDown(Button.LEFT) mouseUp() type(c, KEY_CTRL) gettext = Env.getClipboard().encode('utf-8') print Text: ,gettext if gettext == compareValue: print Pass else: print Fail # testnow() # should not be called here Script2: Test1 from sikuli import * # not needed in main script import codecs # not needed since not used here import test reload(test) test.testnow() -- 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 #259679]: Failure Screenshots with timestamp
Question #259679 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259679 Status: Open = Answered RaiMan proposed the following answer: yes, you might modify the function generateTestScreenshot like this: # added by RaiMan def generateTestScreenshot(self, test): imgdir = self.dirTestScreenshots imgpath = '' if imgdir: x = str(test).split() tf = x[0] tc = x[1].split('.')[1][:-1] tt = int(time.time()*100) imgpath = os.path.join(imgdir, %s-%s-%s.png%(tc, tf, tt)) shutil.move(capture(SCREEN), imgpath) return imgpath which will add a timestamp to the filename (stepping is 0.01 seconds, which should be sufficient) -- 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 #259679]: HTMLTestRunner: Failure Screenshots with timestamp
Question #259679 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259679 Summary changed to: HTMLTestRunner: Failure Screenshots with timestamp -- 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 #259459]: How to overcome the screen resolution issue or browser issues.
Question #259459 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259459 Status: Answered = Open Atul Desai is still having a problem: Hi All, I am unable to understand the solution provided by Eugene and sound difficult for me as I don't have any idea about 'InfrView' can anybody help me either in understanding the 'InfraView', it's implementation and integration with sikuli or help me with some other solution. Thanks, -- 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 #259687]: UnicodeEncodeError when calling a script in some other script
Question #259687 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259687 Status: Answered = Open Atul Desai is still having a problem: Hello Raiman, Thank you for you solution. I tried the solution but still get following error while exection. [error] script [ test1 ] stopped with error in line 1 [error] SyntaxError ( !!WHILE IMPORTING!! Non-ASCII character in file 'D:\Users\Administrator\Desktop\test.sikuli\test.py', but no encoding declared; see http://www.python.org/peps/pep-0263.html for details ) -- 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 #259459]: How to overcome the screen resolution issue or browser issues.
Question #259459 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259459 Status: Open = Answered RaiMan proposed the following answer: What Eugene suggests is simply to enlarge or shrink a given set of images to a target resolution using an image processing tool, that can do one or more actions on a set of images (called batch mode, e.g. all images in one folder). The suggested tool is IrfanView, which can be freely downloaded from the net and runs on Windows. But this is only a convenience method in the special case, where simple resizing works. In general the approach in this case is: preperation - for each resolution have a set of images - each set should be stored in a different folder - each image with the same content in the different folders should have the same name usage at runtime - at the beginning detect or set the resolution somehow (many ways to do that ;-) - according to the given resolution select the correct image folder and use setBundlePath() or addImagePath(), to make sure, the script now uses the images from the correct set with this approach you can use the same script with no modification with all resolutions, that you have prepared before with an image folder. Except at the beginning, there is no resolution specific code needed. If suitable, then a tool like IrfanView can help to reduce the effort in the preparation step, since you might save the time to shoot all images again for a different resolution (if simple resizing works). -- 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 #259687]: UnicodeEncodeError when calling a script in some other script
Question #259687 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259687 Status: Open = Answered RaiMan proposed the following answer: In this case, the source of your imported script contains one or more unicode/utf-8/non-ASCII characters (might be in comments). If this is by intention, then put the following line at the beginning of the imported file # -*- coding: utf-8 -*- BTW: compareValue = We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click “Switch Back.” if this is not a typo here, the this is wrong and has to be (escaped double quote inside) compareValue = We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click \“Switch Back.\” or (wrapping single quote) compareValue = 'We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click “Switch Back.”' -- 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 #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 RaiMan proposed the following answer: -- at comment #6 @Eugene of course your approach is suitable in cases, where you know the spots, where 2 images might differ. But in this case, this is not necessary, since the similarity score already differs (0.99 versus 1.00) Generally your approach is only a workaround for the current weak implementation (score rounded to 2 decimals). If 2 images differ in some pixels, then this should be detectable. The solution is, to work with the original float values, that might show the fact we are different only in some decimal position beyond the 3rd (which now makes the difference). Since this cannot be fixed easily, but needs a revision in my places including native code, I have put it on the list for version 1.2. BTW: since we have a change detection with the observe feature already (onChange), I guess, it is rather easy to add a feature, that might return a list of areas in the image, that contain differences between 2 images. (also something for 1.2). 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 #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 Eugene Maslov posted a new comment: Raimund, by the way, in the script from #6 http://www.hohmodrom.ru/upload/3/projimg/125631/files/color_confusion.gif if I reduce MinSimilarity to 0.9, so that the script passes ok, then increase to 1.00 and run again in the same IDE, it continues to run successfully. Build 2014-09-18. -- 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 #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 RaiMan proposed the following answer: @comment #7 @Eugene Ok, now I understand, what you mean with solved in Java API in class Location there is a method getColor() that internally uses the Robot feature you found and returns a java.awt.Color object. So your solution can be made a bit smoother (no need for the Robot): def findWithColor(img, reg=SCREEN, color=Color(255,255,255), probe=[0,0], debug=False): res=None reg.findAll(img) found=list(reg.getLastMatches()) for but in found: probePoint=but.getCenter().offset(probe[0],probe[1]) myColor=probePoint.getColor() if debug: print color at +str(probePoint.x)+: +str(probePoint.y)+:,myColor if myColor==color: res=but if not debug: break return(res) For a convenient usage on the scripting level, getColor() should return a list of the RGB values, so you could simply use (no ref to any java stuff) if (255, 255, 255) = somePoint.getColore(): print the spot is white --- One more thing: Again this is only a workaround for the fact, that currently small differences between images (in the sense of OpenCV::matchTemplate()) cannot be detected with Sikuli's weak similariity score implementation (see the other comments above). -- 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 #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 RaiMan proposed the following answer: @comment #9 @Eugene the problem is addressed in comment #3 comment: version 1.1.0 has a feature, that stores the last match with the image and with the next search the image is first searched, where it was before, which speeds things up with a factor 50 ... 100. In this special case it leads to a problem (I will fix that). So for now we have to switch the feature off for the check and on again afterwards. ... and is fixed with the next build on January 5th -- 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 #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 RaiMan proposed the following answer: @Eugene LOL, much ado about nothing ... A major reason for the problems we are currently discussing in version 1.1.0 at least, is the above mentioned bug in the CheckLastSeenFirst feature, which is fixed now (available January 5th). So this workaround helps in such cases until then (taking Eugenes pressed/unpressed example): Settings.CheckLastSeen = False pressed = image of pressed button.png notpressed = image of not pressed button.png if exists(Pattern(pressed).exact(), 0): print button is pressed if exists(Pattern(notpressed).exact(), 0): print button is not pressed The evaluated scores of the button images used against the other (pressed-image on unpressed button and vice versa) result in a score of rounded 0.97 (exactly 0.960901379585 and 0.96352738142), which is really enough to distinguish. In the original example of this question the match scores are 0.99413305521 and 0.994715809822, which again are enough to distinguish with Pattern().exact(), but are rather low (a significant difference to 1.0...) because of the large areas of even color. When leaving out most of the background with the shots, the match score goes up to 0.99. -- 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 #259459]: How to overcome the screen resolution issue or browser issues.
Question #259459 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259459 Status: Answered = Solved Atul Desai confirmed that the question is solved: Awesome! Thank you RaiMan for detailed explanation. Thank you Eugene for your efforts and inputs as well. -- 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 #259687]: UnicodeEncodeError when calling a script in some other script
Question #259687 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259687 Status: Answered = Open Atul Desai is still having a problem: Thank you RaiMan , that solved the issue. Just curious to know how does # -*- coding: utf-8 -*- works. -- 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 #259693]: Clicking on multiple appearing images for a specific time
New question #259693 on Sikuli: https://answers.launchpad.net/sikuli/+question/259693 Hi, I need help with code that will click as many images as possible on a specific region where out of five images usually one or two at a time will appear multiple times for around 3 seconds in a 30 second timeline. It's my second day with code apart from html and css, all I have is click(region.wait(img1.png, 30)) All this does of course is click one type of image once. -- 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 #259695]: Sikuli not working on Mac Version 10.10.1
New question #259695 on Sikuli: https://answers.launchpad.net/sikuli/+question/259695 Hi all, I am trying to get Sikuli working on my MacBook Pro which is running version 10.10.1. When I try and run the application it will not open and run. Has anyone resolved this issue? Joe -- 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 #259695]: Sikuli not working on Mac Version 10.10.1
Question #259695 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259695 Status: Open = Answered RaiMan proposed the following answer: look bug 1362011 -- 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 #259687]: UnicodeEncodeError when calling a script in some other script
Question #259687 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259687 Status: Open = Answered RaiMan proposed the following answer: look at the link in the original error message (you have it in the starting question above ;-) -- 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 #259693]: Clicking on multiple appearing images for a specific time
Question #259693 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259693 Status: Open = Answered RaiMan proposed the following answer: Sounds like some online game, that you want to bot ;-) For someone without programming/scripting experience this is a challenge ;-) ... and it is a timing problem, since the searches normally are not done in parallel. So checking 5 images for existence one after the other might take too long, but this depends on the size of the search region (the smaller, the faster). a basic approach: end = time.time() + 30 # the duration of one cycle (timeline as you say) reg = define the region, where the images appear img1 = shot of image 1 img2 = shot of image 2 img3 = shot of image 3 img4 = shot of image 4 img5 = shot of image 5 while time.time() end: # loop until 30 seconds have elapsed if reg.exists(img1, 0): # look for the image and come back immediately if not found click(reg.getLastMatch()) # click it if found if reg.exists(img2, 0): click(reg.getLastMatch()) if reg.exists(img3, 0): click(reg.getLastMatch()) if reg.exists(img4, 0): click(reg.getLastMatch()) if reg.exists(img5, 0): click(reg.getLastMatch()) # at this point we start again with the 1st image mind the leading blanks (Python indentation) come back in any case -- 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