如何同时运行两个命令

发布于 2021-02-22 19:12:49

如何在命令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

查看更多

关注者
0
被浏览
591
0 个回答
暂无答案,快来添加答案吧

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览