wujian123007 wujian123007
广泛交友非外貌协会,聊得来就聊聊不来算,多一个朋友对一段经历
关注数: 26 粉丝数: 21 发帖数: 937 关注贴吧数: 10
帮你们到这了 脚本 SCREEN_RESOLUTION="640x1136"; SCREEN_COLOR_BITS=32 --自动关闭游戏APP function y_AutoClose() closeApp("com.tencent.hero") end --根据坐标触摸调用完成点击操作 function y_touchDU(x,y) touchDown(1,x,y) mSleep(100) touchUp(1,x,y) end --获取设备类型,判断App是否在前台 function y_GameDetection() devicetype = getDeviceType() --获取设备类型 if devicetype == 1 then appID = isFrontApp("com.tencent.hero") --判断App是否在前台运行 if appID == 1 then wLog("yyhero","检测到游戏,等待3秒进入!") mSleep(3000) y_fortop() else dialog("请将游戏切换至前台在运行脚本",3) end else dialog("抱歉,目前版本不支持您的设备类型!",3) end end function y_forcenter(isdo) while true do if isdo == "0" then y_Next() end mSleep(300) if y_SelectNoneHero()=="0" then--0没有英雄,1存在英雄 mSleep(300) y_SelectHero() mSleep(300) y_EnterFire() mSleep(300) else y_EnterFireCenter() mSleep(300) end --开始推塔 re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_SelectCt()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) y_ConfirmFire() mSleep(100) for e=1,2 do --内循环2次 wLog("yyhero","内循环2次:["..(e).."]次") re = y_forend()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end end re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) maxlvlcolor = getColor(358,668) --推塔最大次数结束 if maxlvlcolor == 0x4e3585 then wLog("yyhero","推塔提前结束!") if y_MaxLvlCloseApp == true then y_AutoClose()--结束APP break elseif y_MaxLvlCloseLua == true then dialog("推塔结束,脚本关闭运行",3) lua_exit() --结束脚本 end break end end end function y_forend() re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_GoOn()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) re = y_SelectCt()--检测是否全体死亡,复活 1,重新开始,0正常 if re=="1" then return "1" end mSleep(100) y_ConfirmFire() mSleep(100) return "0" end --开始循环 function y_fortop() wLog("yyhero","进入游戏!"..(y_MaxLvl)) mSleep(5000) dialog("5秒后脚本自动执行!",3) while true do x,y = findColorInRegionFuzzy(0x022c5b,98,387,944,479,1038); --在屏幕坐标左上角 1,1 右下角900,600矩形区域内寻找颜色0x022c5b,并设置精确度为90 if x ~= -1 and y ~= -1 then --如果找到符合以上要求的点 mSleep(1000) y_touchDU(465,986)--点击历练 mSleep(1000) y_touchDU(544,694)--点击推塔 mSleep(100) d = y_MaxLvl for i = 1,d do --外循环3次 y_Begingame() end closeLog("yyhero") break else mSleep(1000) end end end function y_Begingame() while true do panelqmttcolor = getColor(320,806) panelqmttcolor1 = getColor(391,820) if panelqmttcolor == 0x7874c6 or panelqmttcolor1 == 0x513382 then y_touchDU(320,806)--点击继续/开始推塔 mSleep(100) wLog("yyhero","y_Begingame()颜色捕获到") mSleep(2000) islvlmaxcolor = getColor(383,661) islvlmaxcolor1 = getColor(292,665) if islvlmaxcolor==0x523382 or islvlmaxcolor1==0x4d3382 then --推塔最大次数结束 wLog("yyhero","挑战到最大关卡.") if y_MaxLvlCloseApp == true then y_AutoClose()--结束APP elseif y_MaxLvlCloseLua == true then dialog("推塔结束,脚本关闭运行",3) lua_exit() --结束脚本 end end --关闭 begin 兼容不是从第一关开始的,但必须是BOSS关卡之后的第一关的. findnextcolor = getColor(570,879) --右侧的下一步 findnextcolor2 = getColor(437,865) enterfireCcolor = getColor(377,856) enterfireRcolor = getColor(580,854) isdo = "0" if findnextcolor == 0x4b3586 or findnextcolor2==0x523382 then wLog("yyhero","y_Next()颜色捕获到") elseif enterfireRcolor == 0x543380 then isdo = "1" wLog("yyhero","进入右边战场颜色捕获到") elseif enterfireCcolor == 0x51317c then isdo = "1" wLog("yyhero","进入中间战场颜色捕获到") else wLog("yyhero","选择血量") y_SelectBlood() mSleep(300) y_NextCenter() mSleep(100) end --关闭 end y_forcenter(isdo) break --跳出循环 else mSleep(1000) wLog("yyhero","y_Begingame()颜色未捕获到:"..(panelqmttcolor)) netbug() end end end --网络异常检测 function netbug() netbugcolor = getColor(312,558) if netbugcolor == 0x232220 then y_touchDU(380,664) --网络异常,点击确认继续 mSleep(3000) y_touchDU(380,30) --点击空白处继续 mSleep(1000) end end --主函数 <blockquote>function main()
1 下一页