1001z
Junior Member
Posts: 51
|
Post by 1001z on Feb 22, 2020 1:03:41 GMT
I trying to scroll and stop until found some text... which setting is (BETA) Fast click and touch
function existsMultiMax(target, region) local oldROI = Settings:getROI() local maxScore = 0 local maxIndex = 0 local match if (region ~= nil) then Settings:setROI(region) end for i, t in ipairs(target) do if (i == 1) then usePreviousSnap(false) else usePreviousSnap(true) end if (exists(t, 0)) then -- check once local score = getLastMatch():getScore() if (score > maxScore) then maxScore = score maxIndex = i match = getLastMatch() end end end
resumeROI(oldROI) usePreviousSnap(false) if (maxScore == 0) then return -1 end return maxIndex, match end function scrollAndFind() while (true) do local found = existsMultiMax({ "a.png", "b.png", "c.png", "d.png" }, region) if (found > -1) then return 1 end swipe(Location(100, 500), Location(100, 450)) end end
Problem is its too fast
The existsMultiMax() (using for if some of them exists) does not done yet.
I want to run fast but also need existsMultiMax should be done 100% before continue swiping
How can I do that without using wait() ?
|
|
|
Post by AnkuLua on Feb 22, 2020 6:52:41 GMT
|
|