e
New Member
Posts: 3
|
Post by e on Jul 9, 2020 23:43:45 GMT
Hi guys, I just made a simple script that clicks if any image matched up with while not condition, this loop will run forever until it finds any image that specified in the condition. The problem is sometimes ankulua's image recognition is not working as expected, I found this is very frustating and hard to see what's going on under the hood. I've spent hours just testing and failing. Please help me!
-- Scenario 1 (Sometimes skip the while not exists)
while (not exists(Pattern("unsubscribe.png"))) do existsClick(Pattern("subscribe.png")) end
-- Scenario 2 (Worked as expected but this is not what I wanted, What if the device lagged out, It clicks the screen but the device got delayed and sometimes didn't respond so it will fail at some point, and also It runs only 1 time when the if condition is true)
while (true) do if(existsClick(Pattern("subscribe.png"))) then break end end
Scenario 1 is more reliable because It will and always click until match up with the condition. What I want is, enter the loop then click subscribe button without throwing any exception, do this until It clicks the subscribe button then the while not condition checks if the unsubscribe button appeared if it appears then the while condition will be false, viceversa. But sometimes It failed and just skip the while not condition. I tried to recapture the image, maybe something is wrong with the image. At the end it didn't work though why this is happened ? Can anybody explain ?
|
|
|
Post by AnkuLua on Jul 10, 2020 8:52:25 GMT
If you want to make sure that subscribe is gone after clicking, try following
while (true) do if(existsClick(Pattern("subscribe.png"))) then wait(1) if (not exists("subscribe.png")) then break end end end
|
|
e
New Member
Posts: 3
|
Post by e on Jul 11, 2020 7:10:52 GMT
If you want to make sure that subscribe is gone after clicking, try following while (true) do if(existsClick(Pattern("subscribe.png"))) then wait(1) if (not exists("subscribe.png")) then break end end end Thanks will try that later
|
|