綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] 自動刷肥 手機 0主程序 求解

[複製連結] 查看: 1780|回覆: 0|好評: 0
跳轉到指定樓層
樓主
qw002qw2 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2014-2-6 02:17
10碎鑽
--腳本描述
DESCRIPTION="主程序";

--解析度調整
width, high = getScreenResolution();
color_bit = getScreenColorBits();
notifyMessage(string.format("%dbit %dx%d",color_bit,width,high));
w = width / 1080
h = high / 1920
--解析度調整

--路徑設定
Touchelper = "/mnt/sdcard/0/"
Ehgy       = "/mnt/sdcard/0/截圖腳本/"
--路徑設定

--圖片路徑設定
image    = "/mnt/sdcard/0/image/"
mingsnap = "/mnt/sdcard/0/image/%s.bmp"
--圖片路徑設定

--參數設定
--關卡&隊友
stage_A  = 6 --(例: 5 = 暗區)
stage_B  = 5 --(例: 3 = 章節三)
stage_C  = 4 --(例: 1 = 關卡一)
stage_D  = 1 --(例: 2 = 隊伍二)
stage_E  = 1 --(例: A = 8 啟用,1_黃道-上篇 2_黃道-下篇)
team_T   = 1 --(例: 5 = 位置五)
team_P   = 0 --(例: 5 = 暗屬性)
team_R   = 0 --(例: 6 = 妖精類)
team_M   = 0 --(例: 5 = 使用次數)
--關卡&隊友
--其他
Plugin   = 1 --(0_不啟動 1_啟動)
Fauto    = 1 --(0_手動選關+自動轉珠 1_全程自動)
psr      = 1 --(0_不回復體力 1_回復體力)
Continue = 0 --(0_不復活 1_復活)
Share    = 0 --(0_不分享卡片 1_分享卡片)
Friend   = 0 --(0_取消 1_確定)
wait1    = 3000  --(全程等待秒數<<1000=1秒>>)
Relink   = 1 --(0_中斷不連接 1_中斷自動連接)
Autocg   = 1 --(0_不自動偵測圖庫 1_自動偵測圖庫)
set_x    = 0 --(修正 X 座標誤差)
set_y    = 0 --(修正 Y 座標誤差)
--其他
--參數設定

--[[
╔═════════════════════╗
║  stage_A <<區域>>                            ║
║------------------------------------------║
║       1_水區 2_火區 3_木區 4_光區            ║
║       5_暗區 6_中塔 7_古神 8_黃道            ║
╠═════════════════════╣
║  stage_B <<章節編號>> (由下往上)            ║
║------------------------------------------║
║    1_位置一 2_位置二 3_位置三 4_位置四   ║  
║    5_位置五 6_位置六 7_位置七            ║
╠═════════════════════╣
║  stage_C <<關卡編號>> (由下往上)            ║
║------------------------------------------║
║1_位置一(中塔用)  2_位置二    3_位置三    ║
║4_位置四          5_位置五    6_位置六    ║
╠═════════════════════╣
║    stage_D <<隊伍編號>> (由左至右)            ║
║------------------------------------------║
║ 1_隊伍一         2_隊伍二         3_隊伍三   ║
║ 4_隊伍四         5_隊伍五                   ║
╠═════════════════════╣
║  team_T <<隊友參數T>> (由下往上)            ║
║------------------------------------------║
║1_位置一 2_位置二 3_位置三 4_位置四       ║
║5_位置五                                    ║
╠═════════════════════╣
║  team_P <<隊友屬性P>>                    ║
║------------------------------------------║
║    1_水 2_火 3_木 4_光 5_暗 0_不指定     ║
║------------------------------------------║
║  team_R <<隊友種族R>>                    ║
║------------------------------------------║
║  1_神 2_魔 3_人 4_獸 5_龍 6_妖 0_預設    ║
║------------------------------------------║
║  team_M <<隊友模式M>>                    ║
║------------------------------------------║
║1_屬性 2_生命 3_攻擊 4_回復 5_次數 0_預設 ║
╚═════════════════════╝
]]

function main()

--各項程式執行
--執行外掛
dofile(Touchelper .. "1_執行外掛.lua")
::A::
--執行關卡參數
dofile(Touchelper .. "2_各項參數.lua")
--判斷連線狀況
if Relink == 1 then
  mSleep(wait1);
  dofile(Touchelper.."判斷連線.lua")
  mSleep(wait1);
  end
--判斷連線狀況
--偵測戰鬥圖檔
  mSleep(3000);
if Autocg == 1 then
  mSleep(9000);
--愛心
  notifyMessage("偵測愛心圖檔中");
x = findColorInRegionFuzzy(0xFF7563, 99, 37*w,810*h,87*w,860*h);
y = findColorInRegionFuzzy(0X8C5531, 99, 37*w,810*h,87*w,860*h);
z = findColorInRegionFuzzy(0x311010, 99, 37*w,810*h,87*w,860*h);
if x ~= -1 and y ~= -1 or z ~= -1 then
  snapmode = "愛心"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),37*w,810*h,87*w,860*h);
  mSleep(wait1);
  end
--愛心
--設定
notifyMessage("偵測設定圖檔中")
x1 = findColorInRegionFuzzy(0xBDB6A4, 99, 1000*w,170*h,1050*w,220*h);
y1 = findColorInRegionFuzzy(0x6B5131, 99, 1000*w,170*h,1050*w,220*h);
if x1 ~= -1 and y1 ~= -1 then
  snapmode = "設定"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),1000*w,170*h,1050*w,220*h);
  mSleep(wait1);
  end
--設定
--執行
notifyMessage("偵測執行圖檔中")
x2 = findColorInRegionFuzzy(0x000000, 99, 120*w,102*h,185*w,187*h);
y2 = findColorInRegionFuzzy(0x6F6F6F, 99, 120*w,102*h,185*w,187*h);
if x2 ~= -1 and y2 ~= -1 then
  snapmode = "執行"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),120*w,102*h,185*w,187*h);
  mSleep(wait1);
  end
--執行
mSleep(1500);
touchDown(0, 1025*w+set_x,195*h+set_y);     
touchUp(0);
mSleep(wait1);
--取消
notifyMessage("偵測取消圖檔中")
x3 = findColorInRegionFuzzy(0x084963, 99, 497*w,1540*h,582*w,1580*h);
y3 = findColorInRegionFuzzy(0xFFFFFF, 99, 497*w,1540*h,582*w,1580*h);
if x3 ~= -1 and y3 ~= -1 then
  snapmode = "取消"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),497*w,1540*h,582*w,1580*h);
  mSleep(wait1);
  end
--取消
touchDown(0, 540*w+set_x, 1545*h+set_y);   
touchUp(0);
mSleep(wait1);
touchDown(0, 127*w+set_x, 127*h+set_y);
touchUp(0);
--執行中
notifyMessage("偵測執行中圖檔中")
x4 = findColorInRegionFuzzy(0x000000, 99, 111*w,102*h,176*w,187*h);
y4 = findColorInRegionFuzzy(0xFFFFFF, 99, 111*w,102*h,176*w,187*h);
if x4 ~= -1 and y4 ~= -1 then
  snapmode = "執行中"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),111*w,102*h,176*w,187*h);
  mSleep(wait1);
  end
--執行中
  end
--偵測戰鬥圖檔

--執行戰鬥判定
dofile(Touchelper .. "3_戰鬥及狀態判定.lua")

--判定背包是否上限
mSleep(2000);
while true do
x5 = findColorInRegionFuzzy(0x706F6D, 99, 390*w+set_x, 575*h+set_y, 690*w+set_x, 625*h+set_y);
y5 = findColorInRegionFuzzy(0x125C65, 99, 420*w+set_x, 1220*h+set_y, 470*w+set_x, 1240*h+set_y);
z5 = findImageFuzzy(image.."背包上限.bmp", 95);
if x5 == -1 and y5 ~= -1 or z5 ~=-1 then
  mSleep(wait1);
  notifyMessage("背包以抵達上限")
  os.exit()
if x5 == -1 and y5 ~= -1 and Autocg == 1 then
  snapmode = "背包上限"
  mSleep(wait1);
  snapshotRegion(string.format(mingsnap, snapmode),390*w,575*h,690*w,625*h);
  mSleep(wait1);
  notifyMessage("背包以抵達上限")
  os.exit()
  end
else
  notifyMessage("關卡已結束重新選關中")
  mSleep(wait1);
  goto A
  end
--判定背包是否上限
end--Fauto
end--main





這是我的主程序的資料  他自動轉珠 神魔 都OK 但是 我設定是中塔   他指點中塔一下 要選章節 就不動了...
到底是哪裡出問題?

「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則