|
Post by AnkuLua on Apr 11, 2020 1:21:56 GMT
Hi, I would like to know what this line of code does: REG.image.image_region:existsClick("image.png", 1) Does it search for the image at the region from REG.image.image_region, I know existclick kind of searches the whole screen for it? If so does make ankulua search for the image again before clicking? The both answers are YES.
|
|
|
Post by shrimp on Apr 11, 2020 11:51:04 GMT
Thank you for the reply! To skip the exist click can I use getLastMatch()?
Also, is there a way to make a click only when it is 100% identical? I am facing a problem where I need to click when 52 appears but it somehow recognizes 32 as similar and clicks when 32 appears.
|
|
|
Post by AnkuLua on Apr 11, 2020 14:12:38 GMT
Thank you for the reply! To skip the exist click can I use getLastMatch()?
Also, is there a way to make a click only when it is 100% identical? I am facing a problem where I need to click when 52 appears but it somehow recognizes 32 as similar and clicks when 32 appears. What's "skip the exist click"? You can set similarity as following existsClick(Pattern("52.png"):similar(0.99))
|
|
|
Post by shrimp on Apr 11, 2020 15:19:37 GMT
I was wondering since existClick has to search the whole screen again to click the image which may waste some time?
existsClick(Pattern("52.png"):similar(0.99))
does the above also apply to exist?
i.e exist(Pattern("52.png"):similar(0.99))?
|
|
|
Post by Exilereven on Apr 11, 2020 17:09:47 GMT
Try using Region, narrow your search region on the screen to a specific area instead of entire screen everytime.
reg = Region(0,0,400,400) --this region would be starting at x,y(top left corner), then the area size is in pixels, in our case 400,400 pixels. adjust as needed for your specific part of the screen you need to search.
existsClick('image.png') --searches entire screen
reg:existsClick('image.png') --searches on our specific area and is now faster.
And yes similar works with the other methods as well, like exists, existsClick, findall, and others but they works the same way stack the syntax on the end using : and make sure your brackets are right.
exists(image) exists(Pattern(image)) exists(Pattern(image):targetOffset(0,600):similar(.90))
|
|
|
Post by shrimp on Apr 12, 2020 1:43:06 GMT
Thanks! Is it possible to do:
reg = Region(0,0,400,400)
reg:exists('image.png') or exist('image1.png)
Or I can only use if statement, i.e if reg:exists('image.png') or reg:exists('image1.png') then...
Because I'm actually search for 3 possible images. If either one appears then the set action will be done. But these image appear for a short amout of time(~1s) and searching for these images if unlucky, do take abit longer than 1s and might miss them all.
|
|