function click(x,y,z) -- 点击函数封装
touchDown(0,x,y)
mSleep(100)
touchUp(0)
mSleep(z)
end
function zhaose(ax,ay,as,bx,by,bs,x,y,z) -- 找按键点击函数封装
if getColor(ax,ay) == as and getColor(bx,by) == bs then
touchDown(0,x,y)
mSleep(100)
touchUp(0)
mSleep(z)
end
end
function main() -- 主入口函数
yd=1 --战机是否向上移动过,0为未移动,1为已移动
yj=0 --战机是否向左移动过,0为未移动,1为已移动
jd=0 --战机是否在无尽战斗,0为未战斗,1为在战斗
while true do --while无限循环开始
keepScreen(true) --截图进内存
if jd == 0 then --如果战机不在无尽战斗中
zhaose(309,809,0x770B17,317,806,0xFFAD00,317,805,2000)--连续登陆领取奖励按键
zhaose(321,568,0x129010,307,568,0x024401,321,568,2000)--确认按键
zhaose(317,715,0x00296F,320,714,0x017FD3,320,714,2000)--公告我知道了按键
zhaose(127,885,0x7D1019,138,882,0xF1BE05,138,882,4000)--无尽模式按键
zhaose(304,895,0x6A0C15,319,894,0xFFAD00,319,894,2000)--出击按键
zhaose(303,415,0x00FF00,194,571,0x003081,184,577,2000)--商人下次吧按键
zhaose(158,858,0x00348C,175,859,0x0079DB,175,859,3000)--继续按键
zhaose(157,867,0x002E7E,176,867,0x007ED5,176,867,3000)--排名上升继续按键
zhaose(158,846,0x002A87,176,848,0x0179D0,176,848,3000)--排名继续按键
zhaose(452,565,0x139111,440,564,0x034801,452,565,5000)--网络连接超时确认键
if getColor( 158,843 ) == 0x00389C and getColor( 174,849 ) == 0x0079DB then
click(174,849,2000) --点击每周排名继续按键
click(319,569,2000) --点击确认按键
click(321,735,2000) --点击我知道了按键
end
if getColor( 524,477 ) == 0xBBC6D3 and getColor( 455,437 ) == 0xF1D309 then
mSleep(15000) --烈火的时间,请根据自己实际更改
yd=0 --战机是否向上移动过,0为未移动,1为已移动
end
keepScreen(false) --删除内存里的截图
end --if jd == 0 条件结束
if yd == 0 then --如果战机没有向上移动过则
if getColor(82,87) == 0xFF1320 and getColor(112,87) == 0xFF1320 then
--BOSS红血条出现则
mSleep(3000);
touchDown(7, 320, 840)
mSleep(100);
X1=320 --战机烈火完后回到画面底下的X坐标
Y1=840 --战机烈火完后回到画面底下的Y坐标
for i=1,14 do --循环14次。如果不想移动太上,可以把14改成小一点的数字
touchMove(7,X1,Y1)
mSleep(100);
Y1=Y1-20
end --循环结束
touchUp(7)
mSleep(100);
yd=1 --记录战机已经向上移动过
jd=1 --记录战机在无尽战斗中
end --找BOSS红血条结束
end --if yd==0 条件结束
mSleep(10)
if yj == 0 then --如果战机没有向左移动则
if getColor( 319,817 ) == getColor( 319,957 ) then
touchDown(7, 320, 840)
mSleep(20);
X1=320 --战机烈火完后回到画面底下的X坐标
for i=1, 6 do --循环6次。向左移动到躲开导弹位置。根据自己的机型调整循环次数。
touchMove(7, X1, 840)
mSleep(100);
X1=X1-10
end
touchUp(7)
mSleep(100);
yj=1 --记录战机向左移动了。
end
end
if yj == 1 then --如果战机向左移动了则
if getColor( 319,817 ) ~= getColor( 319,957 ) then
--第一次找中间没红线
mSleep(500);
if getColor( 319,817 ) ~= getColor( 319,957 ) then
--第二次找中间没红线
mSleep(500);
if getColor( 319,817 ) ~= getColor( 319,957 ) then
--第三次找中间没红线
mSleep(500);
touchDown(7, X1,840)
mSleep(20);
for i=1, 6 do --循环6次。回到中间位置。根据自己的机型调整循环次数。
touchMove(7, X1,840)
mSleep(100);
X1=X1+10
end --循环结束
touchUp(7)
mSleep(100);
yj=0 --记录战机回到中间了。
end --第三次找中间没红线结束
end--第二次找中间没红线结束
end --第一次找中间没红线结束
end--if yj==1 条件结束
keepScreen(true) --截图进内存
if getColor( 371,555 ) == 0x149411 and getColor( 209,556 ) == 0x0079DA then
jd=0 --记录战机不在无尽战斗中
click(209,556,4000) --点击返回按键
end --找返回按键结束
if getColor( 307,718 ) == 0x83141C and getColor( 320,718 ) == 0xC76C00 then
jt=0 --是否需要截图,需要截图的话,把0改成1
if jt == 1 then
time = getNetTime()
mSleep(100)
snapshotScreen(string.format("/var/touchelf/%s.jpg",os.time()));
mSleep(1000) --路径可以你自己想要的
end--if jt==0 条件结束
click(320,718,2000) --点击箱子领取按键
end --点击箱子领取按键结束
keepScreen(false) --删除内存里的截图
end --while无限循环结束
end