Post by thaddeusgreene on Mar 29, 2017 6:28:05 GMT
So one of many images appears on the screen. I'm trying to identify which one it is and then click the appropriate name for it.
Obviously the problem is the way I have my code setup...
...
local reg1 = Region(98, 440, 2, 2)
--micro region to assess which image is present
local reg2 = Region(17, 753, 680, 340)
--region for the 4 name choices
while z < 5 do
--to loop through all possibilities 5 times
z = z + 1
--while a < 1 do
--these are included in an attempt to exclude this possibility on the next pass if it was already found once
if (reg1:exists("captain2.png")) then
click(reg2:exists("captain1.png"))
a = 1
wait(2)
end
toast("1")
--only included to assess the progress on the script while it is running. Im sure it slowed things down.
--end
--while b < 1 do
if (reg1:exists("doctor2.png")) then
click(reg2:exists("doctor1.png"))
b = 1
wait(2)
end
toast("2")
--end
...
It reads the pattern within a very small region (I assumed it would make the script faster to have a very small region) and then compares against the known pattern. If its a match it then scans the four name choices and clicks the right one. If it doesnt match it moves on to the next possibility, rescans the region and compares against the next possibility. For my script to work the way it needs to the scan and analyze needs to take roughly 0.25 seconds each assuming that the correct match is the last possibility. I am using a rooted S3. I tried running with Daemon on my S6 but it was only marginally quicker and the app read something as fraudulent and checked correct answers as incorrect every time with this method. It did not happen with the rooted S3 though.
I am hoping that there is a way to scan the micro region on the screen once and then compare against my .png files until the correct one is found. Yet another assumption on my part, but, wont this method make things much fast?
I do not need the toasts in my script. It was my way of assessing how the script was progressing while it was active. It seemed to take between 1-1.5 seconds to scan and analyze each possibility based on how quickly the toast messages were popping up.
I have other questions but for now this is the most pressing. Thank you in advance for any pointers.
Obviously the problem is the way I have my code setup...
...
local reg1 = Region(98, 440, 2, 2)
--micro region to assess which image is present
local reg2 = Region(17, 753, 680, 340)
--region for the 4 name choices
while z < 5 do
--to loop through all possibilities 5 times
z = z + 1
--while a < 1 do
--these are included in an attempt to exclude this possibility on the next pass if it was already found once
if (reg1:exists("captain2.png")) then
click(reg2:exists("captain1.png"))
a = 1
wait(2)
end
toast("1")
--only included to assess the progress on the script while it is running. Im sure it slowed things down.
--end
--while b < 1 do
if (reg1:exists("doctor2.png")) then
click(reg2:exists("doctor1.png"))
b = 1
wait(2)
end
toast("2")
--end
...
It reads the pattern within a very small region (I assumed it would make the script faster to have a very small region) and then compares against the known pattern. If its a match it then scans the four name choices and clicks the right one. If it doesnt match it moves on to the next possibility, rescans the region and compares against the next possibility. For my script to work the way it needs to the scan and analyze needs to take roughly 0.25 seconds each assuming that the correct match is the last possibility. I am using a rooted S3. I tried running with Daemon on my S6 but it was only marginally quicker and the app read something as fraudulent and checked correct answers as incorrect every time with this method. It did not happen with the rooted S3 though.
I am hoping that there is a way to scan the micro region on the screen once and then compare against my .png files until the correct one is found. Yet another assumption on my part, but, wont this method make things much fast?
I do not need the toasts in my script. It was my way of assessing how the script was progressing while it was active. It seemed to take between 1-1.5 seconds to scan and analyze each possibility based on how quickly the toast messages were popping up.
I have other questions but for now this is the most pressing. Thank you in advance for any pointers.