|
Post by alexgwee on May 7, 2019 6:30:06 GMT
Advanced skills: Simply generated script can't meet your requirements. You can modify the generated luar to do more. modified action: Want to do more when some image found, rewrite the action. The variable matchResult is the match result. Here are some example.------ 1 ----- touchList[index] = {target = "1.png", region = Region(612, 493, 150, 150), id = "1", action = 'click("realTarget.png")'} index = index + 1 ------ 2 ----- touchList[index] = {target = "2.png", region = Region(774, 493, 150, 150), id = "2", action = 'click(matchResult); wait(2)'} index = index + 1 ------ 3 ----- touchList[index] = {target = "3.png", region = Region(174, 293, 150, 150), id = "3", action = 'dofile("3.lua")'} index = index + 1 Read more: ankulua.boards.net/thread/326/general-script-most-games-snap#ixzz5nDYeDyF5How do I do image matched then do the action
|
|
|
Post by AnkuLua on May 7, 2019 6:56:03 GMT
Advanced skills: Simply generated script can't meet your requirements. You can modify the generated luar to do more. modified action: Want to do more when some image found, rewrite the action. The variable matchResult is the match result. Here are some example.------ 1 ----- touchList[index] = {target = "1.png", region = Region(612, 493, 150, 150), id = "1", action = 'click("realTarget.png")'} index = index + 1 ------ 2 ----- touchList[index] = {target = "2.png", region = Region(774, 493, 150, 150), id = "2", action = 'click(matchResult); wait(2)'} index = index + 1 ------ 3 ----- touchList[index] = {target = "3.png", region = Region(174, 293, 150, 150), id = "3", action = 'dofile("3.lua")'} index = index + 1 Read more: ankulua.boards.net/thread/326/general-script-most-games-snap#ixzz5nDYeDyF5How do I do image matched then do the action what are the actions?
|
|
|
Post by alexgwee on May 7, 2019 8:42:22 GMT
How do I do image matched then do the action what are the actions? Waiting 1.png appear on screen Image matched 1.png appear on screen Then Action click on 1.png
|
|
|
Post by AnkuLua on May 7, 2019 8:59:20 GMT
Waiting 1.png appear on screen Image matched 1.png appear on screen Then Action click on 1.png This is the basic functions of snap and play. You can record the click on 1.png then playback the recorded script.
|
|
|
Post by alexgwee on May 7, 2019 9:06:39 GMT
Waiting 1.png appear on screen Image matched 1.png appear on screen Then Action click on 1.png This is the basic functions of snap and play. You can record the click on 1.png then playback the recorded script. I tried that. Even the image of 1.png doesn't matching they still proceed to actions. All I want is my game character dead then ankulua script detect dead then only do the revive. Is this possible? Sorry I'm still learning about ankulua script.
|
|
|
Post by AnkuLua on May 7, 2019 9:11:32 GMT
This is the basic functions of snap and play. You can record the click on 1.png then playback the recorded script. I tried that. Even the image of 1.png doesn't matching they still proceed to actions. All I want is my game character dead then ankulua script detect dead then only do the revive. Is this possible? Sorry I'm still learning about ankulua script. What's your device? Which method did you use, daemon or root? Don't use media protection and accessibility mode on emulators. You can also check the recorded 1.png correct or not. The recorded images are under luar/....Image directory
|
|
|
Post by alexgwee on May 7, 2019 11:03:15 GMT
I tried that. Even the image of 1.png doesn't matching they still proceed to actions. All I want is my game character dead then ankulua script detect dead then only do the revive. Is this possible? Sorry I'm still learning about ankulua script. What's your device? Which method did you use, daemon or root? Don't use media protection and accessibility mode on emulators. You can also check the recorded 1.png correct or not. The recorded images are under luar/....Image directory I use mobile phone the accessibility mode on
|
|
|
Post by davelee on May 8, 2019 14:17:15 GMT
cant get an easy swipe to work can some 1 help?
just need a swipe from region to region
no need png find
|
|
|
Post by jmaheux on May 10, 2019 15:41:38 GMT
I'm having the same issue. I only need a swipe gesture to scroll the screen. There is no images I can use. Can it be done with snap and play? Thanks
|
|
|
Post by AnkuLua on May 10, 2019 15:54:07 GMT
I'm having the same issue. I only need a swipe gesture to scroll the screen. There is no images I can use. Can it be done with snap and play? Thanks In snap and play, the script need to find some image then do some actions. Or you can use record and play. ankulua.boards.net/thread/179/record-play
|
|
|
Post by mahnster on May 15, 2019 21:27:16 GMT
touchList[index] = {target = "rep1.png", region = Region(688, 597, 150, 150), id = "rep1", action = 'click'} index = index + 1
Trying to basically get this to just repeat a set amount of times, but the option in the playback doesnt work. Im not sure if i need a delay or something, but say i put 22, it will work like 3 times then think it found the image all 22 times. Any ideas?
|
|
|
Post by AnkuLua on May 15, 2019 23:02:31 GMT
touchList[index] = {target = "rep1.png", region = Region(688, 597, 150, 150), id = "rep1", action = 'click'} index = index + 1 Trying to basically get this to just repeat a set amount of times, but the option in the playback doesnt work. Im not sure if i need a delay or something, but say i put 22, it will work like 3 times then think it found the image all 22 times. Any ideas? Turn on debug and the script will highlight when the target found. It will also report in the message dialog when the script terminated.
|
|
|
Post by mahnster on May 15, 2019 23:48:12 GMT
touchList[index] = {target = "rep1.png", region = Region(688, 597, 150, 150), id = "rep1", action = 'click'} index = index + 1 Trying to basically get this to just repeat a set amount of times, but the option in the playback doesnt work. Im not sure if i need a delay or something, but say i put 22, it will work like 3 times then think it found the image all 22 times. Any ideas? Turn on debug and the script will highlight when the target found. It will also report in the message dialog when the script terminated. Oh okay, i see the red box every few seconds, but the image isnt there. Maybe my picture is too big or something so its picking up something in background. Thanks ill experiment. Weird, it just seems to click regardless.
|
|
|
Post by lakatl on May 19, 2019 11:18:25 GMT
Hello! I would like to know if there's a way to expand the searching area for one click but not the others - you see, there's this X sized 100x100 pixels or so but this X could be in the top right or top left corner so I'd like to have a wide search region to make sure it gets clicked no matter where it is.
In addition to that, this X could vary on colour and background, say it's white with light background once but black with light background after - and even changes location. To solve that, I'm considering recording more types of that X so it's recognised every time. For that, I want the script to move on to the next step after it finds any variety of this X, possibly with one step/click (I also want it to wait but I don't know if that could be resolved with the same step/click).
I'm looking for something like this:
------ 1 ----- target = "1.png" or target = "2.png" or target = "3.png"
What is the simplest way to solve it, if there's any?
|
|
|
Post by AnkuLua on May 19, 2019 11:57:12 GMT
Hello! I would like to know if there's a way to expand the searching area for one click but not the others - you see, there's this X sized 100x100 pixels or so but this X could be in the top right or top left corner so I'd like to have a wide search region to make sure it gets clicked no matter where it is. In addition to that, this X could vary on colour and background, say it's white with light background once but black with light background after - and even changes location. To solve that, I'm considering recording more types of that X so it's recognised every time. For that, I want the script to move on to the next step after it finds any variety of this X, possibly with one step/click (I also want it to wait but I don't know if that could be resolved with the same step/click). I'm looking for something like this: ------ 1 ----- target = "1.png" or target = "2.png" or target = "3.png" What is the simplest way to solve it, if there's any? It's easy to change the search area. Just modify the corresponding region in luar. If assigning nil to region, it will search the whole screen. If colors of the pictures are very different, you may need to record them separately. You may try clicking them many times. Please turn on the "Detect duplication". Then if AnkuLua find the pictures could be found by previous recorded picture, it would not be recorded.
|
|