Persistently Find Image/Color [Seth@WiiPlaza]
This simplified formula I made is tested working on AutoTouch 7.1.6 on iOS 14.
I have incorporated the findColor and findImage function(s) and enclosed the entire code block with an indefinite executing loop. The code will repeatedly find the image, perform taps, sleep for a specified duration, and check for color matches. To find the 7-digit 'XXX' color value of your pixel for the code I recommend using the built-in findColor helper on AutoTouch 7.1.6
-- Time: 2023-06-21 11:51:30
-- code by Seth@WiiPlaza
while true do
local result = findImage("/var/mobile/Library/AutoTouch/Scripts/Records/IMAGE FILE NAME.PNG") -- insert your value
for i, v in pairs(result) do
tap(v[1], v[2])
end
usleep(1999999)
local results = findColor(XXXXXXX, X, nil) -- insert your value
if results ~= nil then
for i, a in pairs(results) do
tap(a[1], a[2])
usleep(200000)
tap(a[1], a[2])
usleep(90167.46)
end
else
log("Nothing here!")
end
end
function tap(x, y)
touchDown(0, x, y)
usleep(16000)
touchUp(0, x, y)
end