Re: [Sikuli-driver] [Question #684119]: Finder object does not reload image when reinstantiated after the image is modified
Question #684119 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684119 Status: Open => Answered masuo proposed the following answer: There is a similar question. https://answers.launchpad.net/sikuli/+question/483025 It may be helpful. -- 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 Status: Answered => Solved xyz_User confirmed that the question is solved: looks like this did it: images = ["1569201199862.png","1569201205664.png"] count = 0 matches = findAnyList(images) if len(matches) == 2: popup('got 2') else: sleep(1) -- 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 Status: Open => Answered Manfred Hampl proposed the following answer: You cannot call 'testingThisFunction()' with an empty parameter list, you always have to provide two images, e.g. 'testingThisFunction("1568620179920-6.png", "1568621143400.png")' -- 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
[Sikuli-driver] [Question #684119]: Finder object does not reload image when reinstantiated after the image is modified
New question #684119 on Sikuli: https://answers.launchpad.net/sikuli/+question/684119 I have a code to perform analysis on a local image using Finder object. The local image (temporary file) is generated from multiple screen capture, overwriting previous one once analysis is done. I did not have problem in overwriting temporary image, however the analysis function gives always the same value, unchanging from initial image generated. It seems the file is stored in memory and does not update when new image file is copied and overwritten by new file, even Finder.destroy() runs each time. Simple code to replicate(tested on openJDK 12.0.2, sikulix: 2019-09-17_07:10 Build 381): # -*- coding: utf-8 -*- import shutil import os from sikuli import * def countPatternFromFile(imgFile,pattern): addImagePath("C:/tmp/") dest = shutil.copy(imgFile, "C:/tmp/temp.png") checkImgFile = Finder("C:/tmp/temp.png") print(imgFile) checkImgFile.findAll(pattern) matches=[] if checkImgFile.hasNext():#if the result is found while checkImgFile.hasNext(): # loop as long there is a first and more matches matches.append(checkImgFile.next())# access next match and add to matches print checkImgFile.hasNext() # is False, because f is empty now checkImgFile.destroy() os.remove("C:/tmp/temp.png") removeImagePath("C:/tmp/") return len(matches) if __name__ == "__main__": addImagePath("C:/src/") stars = ["C:/src/3stars.png", "C:/src/5stars.png", "C:/src/0stars.png"] for starimg in stars: count=countPatternFromFile(starimg,"C:/src/star.png") print(count) This code worked in past build (around build 200~), but not in recent build. Was there a change in behaviour? Can there be some method to explicitly reload a file for Finder object? 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 Status: Solved => Open xyz_User is still having a problem: I seem to be getting an error as well: testingThisFunction() #Random Target TypeError: calliopeMassCureWounds() takes exactly 2 arguments (0 given) Here's the code: def testingThisFunction(first, second): imageCount = 0 if squareArea2.exists(first,0.5): imageCount += 1 if squareArea4.exists(second,0.5): imageCount += 1 return imageCount == 2 if testingThisFunction("1568620179920-6.png", "1568621143400.png"): doubleClick(Location(639,686)) click(Location(Location(664, 572))) callMyNextFunction() waitForUi() else: sleep(0.1) -- 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 RaiMan posted a new comment: No Need to stop asking. It is my decision wether, when or how I answer ;-) -- 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 Status: Answered => Solved xyz_User confirmed that the question is solved: I am full of gratitude once again, I promise to stop asking questions for the next little while :) -- 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 #684105]: Finding Two different images
Question #684105 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684105 Status: Open => Answered RaiMan proposed the following answer: that's not Python ;-) I would do it like this (if the function makes sense at all, only if needed more than once) def findTwoImages(first, second): imageCount = 0 if exists(first): #waits 3 secs for first imageCount += 1 if exists(second): #waits 3 secs for second imageCount += 1 return mageCount == 2 if findTwoImages("1569100025263.png", "1569100032614.png,3"): popup('got 2') This only works, if the first image appears within 3 seconds (no matter what is with the second image). You might also have a look at the feature findAny(). -- 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 #683709]: Having to kill vnc between every action
Question #683709 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683709 Status: Open => Expired Launchpad Janitor expired the question: This question was expired because it remained in the 'Open' state without activity for the last 15 days. -- 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 #683707]: Possible to load a screenshot from disk and match smaller image?
Question #683707 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683707 Status: Open => Expired Launchpad Janitor expired the question: This question was expired because it remained in the 'Open' state without activity for the last 15 days. -- 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