如何在命令1运行时出现命令2找到的色同时运行?
-- 点击函数封装
function click(x, y)
touchDown(0, x, y)
mSleep(100)
touchUp(0)
end
-- 主入口函数
function main()
-- 命令1
x, y = findColorInRegion(0x254162,843,54,843,54)
if x~= -1 and y~= -1 then
touchDown(0, 786+math.random(-5,5), 257+math.random(-5,5))
mSleep(2000+math.random(-100,100))
touchUp(0)
mSleep(1000+math.random(-100,100))
touchDown(0, 925+math.random(-5,5), 255+math.random(-5,5))
mSleep(500+math.random(-100,100))
touchUp(0)
mSleep(1000+math.random(-100,100))
touchDown(0, 787+math.random(-5,5), 1249+math.random(-5,5))
mSleep(500+math.random(-100,100))
touchUp(0)
mSleep(1000+math.random(-100,100))
touchDown(0, 79+math.random(-5,5), 1246+math.random(-5,5))
mSleep(500+math.random(-100,100))
touchUp(0)
mSleep(22000+math.random(-1000,1000))
end
-- 命令2
x1, y1 = findColorInRegion(0xE69A0D,516,1494,516,1494)
if x1~= -1 and y1~= -1 then
touchDown(1, 843+math.random(-5,5), 1689+math.random(-5,5))
mSleep(500+math.random(-100,100))
touchUp(1)
mSleep(1000+math.random(-100,100))
end
end