浅笑己无能 浅笑己无能
关注数: 23 粉丝数: 318 发帖数: 4,306 关注贴吧数: 44
应那位小盆油哒要求,发布自动打怪脚本 540/960的屏幕 本人htcg19测试可用 删除无用代码,估计报错,希望大家以学习为目的 hp80 = {865,213,0,0,1,--hp 86,87,8,158,0, }; tz = {0,0,0,0,4, --游戏界面特征 58,15,239,231,231, 104,41,222,215,198, 57,101,206,182,132, 104,67,173,142,107, }; gj = {867,274,0,0,4,--攻击 168,16,156,150,123, 163,16,148,138,115, 147,51,214,215,198, 158,52,148,138,123, }; sw = {228,45,0,0,16, --死亡(怪物) 227,46,140,130,123, 230,45,140,134,132, 224,14,239,239,239, 224,92,189,162,107, 224,99,189,170,115, 224,98,181,154,107, 216,21,57,60,57, 227,28,57,60,57, 235,33,57,60,57, 216,31,57,60,57, 198,31,57,60,57, 216,28,57,60,57, 229,29,57,60,57, 236,29,57,60,57, 224,29,57,60,57, 219,34,57,60,57, }; sw1 = {0,0,0,0,1, 226,95,33,77,33, }; jdx = {815,484,0,0,10, --捡东西 671,22,239,142,49, 671,31,255,150,49, 680,35,255,154,49, 692,28,255,154,49, 692,40,239,142,41, 700,29,247,146,49, 704,29,239,142,41, 715,28,255,150,49, 721,28,255,150,49, 719,38,247,146,49, }; wjsr = {365,362,0,0,11,--玩家骚扰 454, 198, 231, 227, 222,--1 460, 203, 222, 199, 165,--2 466, 207, 214, 178, 123,--3 470, 208, 239, 199, 148,--4 473, 209, 222, 178, 123,--5 475, 210, 214, 174, 115,--6 478, 210, 231, 186, 123,--7 480, 210, 239, 190, 132,--8 484, 210, 231, 186, 123,--9 488, 209, 222, 178, 123,--10 492, 208, 239, 195, 132,--11 }; function click(x,y,t)--单击 touchDown(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); mSleep(math.random(15,50)); touchMove(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); mSleep(math.random(150,150+t)); touchUp(0); mSleep(math.random(200,500)); end function click2(x,y,t)--双击 touchDown(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); mSleep(math.random(80,80+t)); mSleep(math.random(15,50)); touchMove(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); touchUp(0); mSleep(math.random(100,100+t)); touchDown(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); mSleep(math.random(15,50)); touchMove(0, x + math.random(-5, 5) , y + math.random(-5, 5) ); mSleep(math.random(80,80+t)); touchUp(0); mSleep(math.random(200,500)); end --找色式找图 show = 0; function ddzs2(t,sim, offset_x0,offset_x, offset_y0, offset_y) local j,h,i; local lr,lg,lb; local flag; h = offset_y0; while h <= offset_y do j = offset_x0; while j<= offset_x do flag = true; i = 6; while (i+4) <= (t[5]*5 + 5) do lr,lg,lb = getColorRGB(t[i] + j,t[i+1] + h); if show == 1 then logDebug(string.format("%d,%d: %d,%d,%d - %d,%d,%d - %d", t[i]+j,t[i+1],lr,lg,lb, t[i+2], t[i+3], t[i+4], i)); mSleep(500); end if math.abs(lr-t[i+2]) > sim then flag = false; break; end if math.abs(lg-t[i+3]) > sim then flag = false; break; end if math.abs(lb-t[i+4]) > sim then flag = false; break; end i = i + 5; end if flag then show = 0; return true; end j = j + 1; end h = h + 1; end show = 0; return false; end rotateScreen(90);--旋转坐标 function main()--主循环 while true do --不被停止循环 mSleep(200); if ddzs2(wjsr,30,0,0,0,0) then --叉交易叉组队叉决斗 click2(wjsr[1],wjsr[2], 100); mSleep(math.random(500,700)); end if not ddzs2(hp80, 30,0,0,0,0) and--血量监控兼回复 ddzs2(tz,30,0,0,0,0) then click(865,213,500) click(922,215,200) mSleep(math.random(300,400)); end if ddzs2(gj, 30,0,0,0,0) and not--打怪 ddzs2(sw,30,0,0,0,0) then --mSleep (math.random(100, 200)) click(866,330,150) click(925,330,150) click(866,390,150) click(925,390,150) elseif ddzs2(sw,30,0,0,0,0) and--怪物死亡 ddzs2(tz,30,0,0,0,0) and not ddzs2(sw1,30,0,0,0,0) then click2(sw[1],sw[2], 100); end if ddzs2(jdx,30,0,0,0,0) and ddzs2(tz,30,0,0,0,0) then --唯一的目的,捡东西 mSleep(math.random(500,700)); click(jdx[1],jdx[2], 400); mSleep(math.random(300,400)); end end end
四区我参与的镰刀 影舞,sk欣哥,杨俊忠,粉色修道院 sk被剑灵拐跑了 杨杨妹子刚刷好 影舞→_→不知道 现在贡献个代码 a={490,360,0,0,10, 443,355,051,006,051,--1 443,360,051,002,051,--2 471,356,074,032,074,--3 465,352,071,026,070,--4 470,352,071,023,070,--5 470,355,060,007,059,--6 472,358,058,009,058,--7 474,366,051,002,051,--8 480,362,050,001,050,--9 483,362,076,027,067,--10 } b={490,310,0,0,10, 443,294,057,004,049,--1 443,295,057,004,049,--2 443,296,049,004,049,--3 451,296,066,016,066,--4 463,296,049,004,049,--5 472,296,049,004,049,--6 485,293,057,012,057,--7 488,293,049,000,049,--8 492,293,057,012,057,--9 495,293,057,012,057,--10 } function click(x,y,t) touchDown(0, x + math.random(-20, 20) , y + math.random(-20, 20) ); mSleep(math.random(15,50)); touchMove(0, x + math.random(-20, 20) , y + math.random(-20, 20) ); mSleep(math.random(150,150+t)); touchUp(0); mSleep(math.random(200,500)); end show = 0; function ddzs1(t,sim) local i = 6; local lr,lg,lb; while (i+4) <= (t[5]*5 + 5) do lr,lg,lb = getColorRGB(t[i],t[i+1]); if show == 1 then notifyMessage(string.format("%d,%d: %d,%d,%d - %d,%d,%d - %d", t[i],t[i+1],lr,lg,lb, t[i+2], t[i+3], t[i+4], i)); mSleep(1000); mSleep(1000); end if math.abs(lr-t[i+2]) > sim then show = 0; return false; end if math.abs(lg-t[i+3]) > sim then show = 0; return false; end if math.abs(lb-t[i+4]) > sim then show = 0; return false; end i = i + 5; end; show = 0; return true; end function ddzs2(t,sim, offset_x0,offset_x, offset_y0, offset_y) local j,h,i; local lr,lg,lb; local flag; h = offset_y0; while h <= offset_y do j = offset_x0; while j<= offset_x do flag = true; i = 6; while (i+4) <= (t[5]*5 + 5) do lr,lg,lb = getColorRGB(t[i] + j,t[i+1] + h); if show == 1 then logDebug(string.format("%d,%d: %d,%d,%d - %d,%d,%d - %d", t[i]+j,t[i+1],lr,lg,lb, t[i+2], t[i+3], t[i+4], i)); mSleep(500); end if math.abs(lr-t[i+2]) > sim then flag = false; break; end if math.abs(lg-t[i+3]) > sim then flag = false; break; end if math.abs(lb-t[i+4]) > sim then flag = false; break; end i = i + 5; end if flag then show = 0; return true; end j = j + 1; end h = h + 1; end show = 0; return false; end function ddzs3(t,sim, x , y) local i = 6; local lr,lg,lb; while (i+4) <= (t[5]*5 + 5) do lr,lg,lb = getColorRGB(t[i] + x,t[i+1] - y); if show == 1 then notifyMessage(string.format("%d,%d: %d,%d,%d - %d,%d,%d - %d", t[i],t[i+1],lr,lg,lb, t[i+2], t[i+3], t[i+4], i)); mSleep(1000); mSleep(1000); end if math.abs(lr-t[i+2]) > sim then show = 0; return false; end if math.abs(lg-t[i+3]) > sim then show = 0; return false; end if math.abs(lb-t[i+4]) > sim then show = 0; return false; end i = i + 5; end; show = 0; return true; end rotateScreen(90); function main() while true do mSleep(200); if ddzs2(a,30,0,0,0,0) then mSleep(math.random(1500,8500)); click(a[1],a[2], 100); mSleep(math.random(400,700)); end if ddzs2(b,30,0,0,0,0) then mSleep(math.random(1500,8500)); click(b[1],b[2], 100); mSleep(math.random(400,700)); end end end 也许是不够高级,但胜在能用 htc g17 g18 g19 都行
首页 1 2 下一页