|
Post by AnkuLua on Oct 31, 2020 2:57:43 GMT
It's random but the range is small. It's between 0.199 to 0.299 We don't provide the accuracy for each item. You can edit the luar and assign each item the similarity. Are you sure its random? For example, wait1 = math.random(9, 99) Say this gives me 10 in the first run of the script, but then when it repeats the script the second time it will use 10 again, and the next time also 10, etc. How do I change that so there is more randomness and its different everytime? Or is math.random the wrong function to use here. Also, which function is used for assigning items a similarity percentage? Thanks. You need to call it every time, such as wait(math.random(9, 99))
|
|
|
Post by jamesp on Nov 1, 2020 12:14:28 GMT
Thanks, gotcha. Guesss I didnt know how variables worked lol. What about the function to use for assigning items a similarity percentage?
|
|
|
Post by AnkuLua on Nov 1, 2020 15:06:12 GMT
Thanks, gotcha. Guesss I didnt know how variables worked lol. What about the function to use for assigning items a similarity percentage? Modify the luar file. change the pure target file name to pattern with similarity. For example if the original target is ..... , target = "target.png", ...... Change it to ..... , target = Pattern("target.png"):similar(0.85), ......
|
|
|
Post by jamesp on Nov 2, 2020 6:08:40 GMT
Thanks, gotcha. Guesss I didnt know how variables worked lol. What about the function to use for assigning items a similarity percentage? Modify the luar file. change the pure target file name to pattern with similarity. For example if the original target is ..... , target = "target.png", ...... Change it to ..... , target = Pattern("target.png"):similar(0.85), ......
Okay I got it, thanks! How would you code another situation where an object is blue, and it detects that it is blue and clicks on it. How do I use getcolor() for objects that are blue? Other times you need to click on the same object when it is gray colored. Can I use getcolor() in the same way and having it detect when its NOT blue? You do not want to mix these two up.
|
|
|
Post by reartwo on Nov 2, 2020 15:38:35 GMT
Hi guys, it's my first time here, I searched and read lots of things but could not find a solution to make the script I was making work. There are two things I did not understand, one is in index 3, is it possible to search for more pngs in a region? then if almost one png is found I'd need to go back to index 2 and repeat 3, this for 2 times maximum, then if one of pngs is found for 3 times I should go to index 9, change team and repeat searching for opponents, or else go on to battle, how can I do that? And in search opponent, if i want to skip change opponent is it correct to use index + 2? --search opponent ------ 1 ----- touchList[index] = {target = "9.png", region = Region(1573, 501, 1040, 640), id = "9", action = 'click'} index = index + 2 --change opponent ------ 2 ----- touchList[index] = {target = "10.png", region = Region(1573, 501, 1040, 640), id = "10", action = 'click'} index = index + 1 --check if opponent has key characters to avoid, if there are go back to 2, if there are not go on to 4 ------ 3 ----- touchList[index] = {target = "cap.png;tha.png;min.png;hel.png;sym.png;emm.png;pho.png;bb.png;iw.png;ult.png;zem.png;oct.png", region = Region(1417, 175, 700, 500), id = "11", action = 'idontknowhowtomakeitgobackto2'} index = index + 1 --battle ------ 4 ----- touchList[index] = {target = "12.png", region = Region(672, 506, 1040, 640), id = "12", action = 'click'} index = index + 1 --autoplay ------ 5 ----- touchList[index] = {target = "13.png", region = Region(-120, -120, 1040, 640), id = "13", action = 'click'} index = index + 1 --x2 if x1 ------ 6 ----- touchList[index] = {target = "14.png", region = Region(-120, -120, 1040, 640), id = "14", action = 'click'} index = index + 1 --x3 if x2 ------ 7 ----- touchList[index] = {target = "15.png", region = Region(-120, -120, 1040, 640), id = "15", action = 'click'} index = index + 1 --continue at end game either win or lose ------ 8 ----- touchList[index] = {target = "16.png", region = Region(653, 574, 1040, 640), id = "16", action = 'click'} index = index + 1 --change team ------ 9 ----- touchList[index] = {target = "17.png", region = Region(-120, 503, 1040, 640), id = "17", action = 'click'} index = index + 1 --stop if battle costs 25 charges ------ 10 ----- touchList[index] = {target = "18.png", region = Region(672, 506, 1040, 640), id = "18", action = 'scriptExit()'} index = index + 1
-EDIT: I found there's a findA_ClickB action, where can I find a list of those actions? Is it possible to have a findA or B or C or D or E_ClickF one?
|
|
|
Post by xenonface on Mar 1, 2021 20:12:02 GMT
Hi, I had an issue to ask. I am using snap and play create 5 step. 1~4 : all are just simple click, working perfect. 5 : I had use the drag to assign if A click B. Funny thing that no matter how long I stay at the same screen, it never find A. But if I stop the script now and run it again, it found A immediately! That means it actually works but can't work without a fresh start every time. Any luck how to solve this? Thanks.
|
|
|
Post by AnkuLua on Mar 2, 2021 0:48:50 GMT
Hi, I had an issue to ask. I am using snap and play create 5 step. 1~4 : all are just simple click, working perfect. 5 : I had use the drag to assign if A click B. Funny thing that no matter how long I stay at the same screen, it never find A. But if I stop the script now and run it again, it found A immediately! That means it actually works but can't work without a fresh start every time. Any luck how to solve this? Thanks. Which AnkuLua version did you use? Always use the latest version. If stuck at the screen, expand the luar. If clicking on other image, it's possible that you need to modify the order of the images in the luar Or modify the action.
|
|
docbt
New Member
Posts: 10
|
Post by docbt on May 29, 2021 16:22:21 GMT
Hi guys! I am new to Ankulua and have some questions about this wonderful snap and play script.
Currently I have a working snap and play script with about 90 steps and it works, but I have to do speed optimizations.
I read the previous pages and know now that I have to add while loops and exits conditions and so on. But maybe it's easier and faster.
Is it possible to jump around to specific index points in the loop? I tried setting index = number in my action, but that doesn't seem to work.
Second question: Setting the correct severity is a pain, cause my game has transparent pngs and sometimes dynamic and animated background.
Do I use this correctly? Pattern("SwipeT.png"):similar(0.9)
Third question: Which emu do you recommend? I was using Memu a few years ago and it was running fast. But the latest version is slow like a 🐌 Is there any lightweight emu?
Thanks in advance, doc
|
|
docbt
New Member
Posts: 10
|
Post by docbt on May 29, 2021 17:25:03 GMT
Ahh and another question:
I installed Anlukua at my 4k Android TV, but I don't see the main menu. Maybe it's outside of the visible area. Any chance to fix this?
My Android TV is fast like hell. Gamespeed is nearly doubled compared to my other devices.
That's why I am interested in let the bot run on this device...
|
|
|
Post by AnkuLua on May 30, 2021 0:01:46 GMT
Hi guys! I am new to Ankulua and have some questions about this wonderful snap and play script. Currently I have a working snap and play script with about 90 steps and it works, but I have to do speed optimizations. I read the previous pages and know now that I have to add while loops and exits conditions and so on. But maybe it's easier and faster. Is it possible to jump around to specific index points in the loop? I tried setting index = number in my action, but that doesn't seem to work. Second question: Setting the correct severity is a pain, cause my game has transparent pngs and sometimes dynamic and animated background. Do I use this correctly? Pattern("SwipeT.png"):similar(0.9) Third question: Which emu do you recommend? I was using Memu a few years ago and it was running fast. But the latest version is slow like a 🐌 Is there any lightweight emu? Thanks in advance, doc Did you turn off debug. Debug slowes down the speed a lot. 1. Setting index directly doesn't help. Because at line 1264, the index is set if (continueScan) then index = choice + 1 end 2. It's correct. 3. No comment. It depends on everyone's environment. As for Android TV, will try it and get back to you.
|
|
docbt
New Member
Posts: 10
|
Post by docbt on Jun 11, 2021 5:53:02 GMT
I maybe have some useful improvement suggestions.
1. Toast the found match in debug mode.
2. Let us define the timeout seconds in regionWaitMulti. It's hardcoded to 30 seconds. Or at least increase the value in debug mode.
3. It would be great to have an option to stop, if every index was checked and nothing was found (screen is static and not changing).
Addionaly save the screenshot (at least in debug mode), so we can check later, which screen is causing the problem
Greetings doc
|
|
|
Post by cutepolarbear on Jun 20, 2021 22:31:39 GMT
is there a way with snap and play to do the negative check, if an image does not exist, click (or do something else in action)? thank you.
|
|
docbt
New Member
Posts: 10
|
Post by docbt on Jun 24, 2021 6:01:05 GMT
First you have to choose an image (main menu or something like that) that exists on the screen you want to check for a non existing image. That's our trigger. If you would trigger on a non existing image, it would fire every time... That's not possible with snap and play.
Than edit the generated lua script with a file manager/editor.
Find your existing image index block. Edit the action to 'If not Region(x,y,width,hight):exists("NonPresentImage.png") then click(location(x,y)) end'
|
|
|
Post by dekaka on Jun 24, 2021 23:58:23 GMT
How to printscreen if image found? is possible when target found action printscreen
|
|
|
Post by AnkuLua on Jun 25, 2021 0:23:03 GMT
How to printscreen if image found? is possible when target found action printscreen To save the screen to files, change action to 'Region(0,0, 10000, 10000):saveColor("screen.png")' And to auto increase the file name change action to 'i = i and (i+1) or 1; Region(0,0, 10000, 10000):saveColor("screen" .. i .. ".png")' The saved files are in snapAndPlay/luar/{name}Image Where {name} is the luar file name
|
|