|
Post by cutepolarbear on Feb 26, 2019 18:13:00 GMT
hi, For basic stuff with snap and play where I literally have just 2 icons on screen and clicking them when they appear, and using searching with regions, the search speed on samsung galaxy s9+ seem pretty slow. Is there an added default pause somewhere in the out of box snap and play lua? Thanks! -cutepolarbear
|
|
|
Post by AnkuLua on Feb 27, 2019 6:43:06 GMT
It should be very fast. Try using accessibility mode in AnkuLua settings.
Or share the created luar file.
|
|
|
Post by cutepolarbear on Feb 27, 2019 21:42:44 GMT
Thank you. I thought so too, from the simple test I did. And I am running in accessibility mode. (I am new to image based macro on android, specifically on phone itself. Previously dealt with some similar image based macro on PC.) Below is a bit more clicks but simply from image detection (i turned debug on and see the red rectangle narrow in), it takes very roughly ~2 seconds to perform each click action. (For now for my specific purpose below, I resorted to using purely click / time based macro but obviously it has its drawbacks, especially when there is lag.) Thanks! -cutepolarbear ----- created by AnkuLua snap and play script ------ immersive = true setImmersiveMode(immersive) genVersion = "8.3.0-pro2" setAutoGameArea = true pcall (autoGameArea, setAutoGameArea) scriptDimension = 1480 Settings:setScriptDimension(true, scriptDimension) Settings:setCompareDimension(true, scriptDimension) local index = 1 touchList = {} waitList = {} ------ 1 ----- touchList[index] = {target = "1.png", region = Region(946, 460, 150, 150), id = "1", action = 'click'} index = index + 1 ------ 2 ----- touchList[index] = {target = "6.png", region = Region(662, 559, 150, 150), id = "6", action = 'click'} index = index + 1 ------ 3 ----- touchList[index] = {target = "4.png", region = Region(675, 514, 150, 150), id = "4", action = 'click'} index = index + 1 ------ 4 ----- touchList[index] = {target = "3.png", region = Region(668, 549, 150, 150), id = "3", action = 'click'} index = index + 1 ------ 5 ----- touchList[index] = {target = "7.png", region = Region(687, 552, 150, 150), id = "7", action = 'click'} index = index + 1 ------ 6 ----- touchList[index] = {target = "2.png", region = Region(694, 521, 150, 150), id = "2", action = 'click'} index = index + 1 ------ 7 ----- touchList[index] = {target = "5.png", region = Region(674, 506, 150, 150), id = "5", action = 'click'} index = index + 1
|
|
|
Post by AnkuLua on Feb 28, 2019 0:02:57 GMT
There are 7 icons to detect, not 2 icons as you reported. It takes time. Did you turn on duplication detection while recording the script?
Turning off debug will improve the speed.
|
|
|
Post by cutepolarbear on Feb 28, 2019 1:39:11 GMT
Yes. I have turned on duplicate detection also and experimented with turning off debug. Yes, why would 2 images versus 7 images make a difference if I am trying to get an idea of roughly how long each individual image recognition would take? (ahhh, it will make a difference if it is iteratively looping through the array of 7 looking for a match. I think that's what it is doing. I actually needed to look for image 1, wait until it finds it, then click, then proceed to look for image 2, and etc.,)
I just have no frame of reference in regards to performance for image detection (in general) on android phone. I understand image detection is an expensive process and will definitely not be as quickly as on PC.
Thanks, -cutepolarbear
|
|
|
Post by cutepolarbear on Feb 28, 2019 3:51:59 GMT
I quickly went over snapAndPlay.lua confirmed that, right, it is iteratively doing image searching for images in touchList [] and if found, performs the action and there is no extra wait / sleep. Not the most efficient operation (for my purpose), but I understand why it's done this way (general purpose).
Thanks again, -cutepolarbear
|
|