|
Post by arcreds on Oct 24, 2017 14:31:23 GMT
I use this in summoners war
function play() toast("Play") existsClick(Pattern("play.png"),1) end
If exists(Pattern("play.png"),0.3) then play() end
Whiçh mean the image Play.png turn to pause image My problem is once it become pause button it will still click on the screen randomly and still recognize the play image but the image is not there because it already turned to pause button.
I already cropped the image many times resize it many times just like my other images using the provided tools in script optimization.. that problem still wont go away..
How do i fix this? Sometimes it affects the other function.. please help me...
Thanks
|
|
|
Post by arcreds on Oct 24, 2017 15:09:28 GMT
plus = Pattern("+.png"):similar(0.8) -- set the similarity on "+.png"
I also found this..
What does :similar do? and what is (0.8) how to get that value 0.8? Thanks
|
|
|
Post by Mercobots on Oct 24, 2017 22:38:16 GMT
can you provide some images ?
similar is the minimum similarity to use in a find operation so when you use 0.8 you say to ankulua to search for an image within a similarity of 80%
|
|
|
Post by arcreds on Oct 25, 2017 3:41:14 GMT
This is the play button And this is what it looked like after click the play button Thanks
|
|
|
Post by arcreds on Oct 25, 2017 3:42:28 GMT
Sometimes it will click the chest of golem or the wing of the diamond monster Btw Im using 1920x1080 resolution for my images then after cropped i use this bat files resize.bat 50% so now its 960? My tablets resolution is 1280x800 thanks
|
|
|
Post by arcreds on Oct 25, 2017 7:39:58 GMT
I think i already fixed it by using :similar(0.8) the toast doesnt appear anymore unless when the play button is visible..
Can i use :similar(0.8) to all of my images? Even if there are multiple images present in the game? I mean like the "Yes" or "Ok" button looks similar at all but with different dialog.
Whats the difference between wait(1) and --wait(1)
Sorry if i asked too much thanks again for explaining :similar
|
|
|
Post by Mercobots on Oct 25, 2017 8:44:01 GMT
Ok 1º of all , ankulua uses by default 0.7 similarity to all images so any time you use a search operation the similar value will be 70% but you can change this default value , at very top of your script add Settings:set("MinSimilarity", 0.8) Now on using Pattern("my_img"):similar(0.9) you are overriding the default value only for this single image. But i recommend the use of regions to avoid the issues your having
function play() btns_r = Region(100, 100, 100, 100)
toast("play")
if btns_r:existsCick("play.png") then return true else return false end end Btw this -- is used to comment lines
|
|
|
Post by arcreds on Oct 25, 2017 14:46:25 GMT
Thanks again for your help it works the region method..
How to get the region? I mean the value like 100 100 100 100
Correct me if im wrong.. with region just like in play button ankulua will only search on that area if the image is present or not?
|
|
|
Post by Mercobots on Oct 25, 2017 18:09:14 GMT
|
|
|
Post by arcreds on Oct 26, 2017 9:26:26 GMT
Thanks so much
|
|