我的腳本:--腳本描述 DESCRIPTION="主程序"; --解析度調整 width, high = getScreenResolution(); color_bit = getScreenColorBits(); notifyMessage(string.format("%dbit %dx%d",color_bit,width,high)); w = 1080 / 1080 h = 1920 / 1920 --解析度調整 --路徑設定 Touchelper = "/mnt/sdcard/0/" Ehgy = "/mnt/sdcard/0/截圖腳本/" --路徑設定 --圖片路徑設定 image = "/mnt/sdcard/0/image/" --圖片路徑設定 --參數設定 --關卡&隊友 stage_A = 0 --(例: 5 = 暗區) stage_B = 0 --(例: 3 = 章節三) stage_C = 1 --(例: 1 = 關卡一) stage_D = 1 --(例: A = 8 啟用,1_黃道-上篇 2_黃道-下篇) team_T = 5 --(例: 5 = 位置五) team_P = 0 --(例: 5 = 暗屬性) team_R = 0 --(例: 6 = 妖精類) team_M = 0 --(例: 5 = 使用次數) --關卡&隊友 --其他 Plugin = 1 --(0_不啟動 1_啟動) Fauto = 1 --(0_手動選關+自動轉珠 1_全程自動) psr = 0 --(0_不回復體力 1_回復體力) Continue = 0 --(0_不復活 1_復活) Share = 0 --(0_不分享卡片 1_分享卡片) Friend = 0 --(0_取消 1_確定) wait1 = 1000 --(全程等待秒數<<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_位置六 ║ ╠═════════════════════╣ ║ 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(12000); if Autocg == 1 then mSleep(2000); notifyMessage("偵測愛心圖檔中"); dofile(Ehgy.."愛心.lua") mSleep(wait1); notifyMessage("偵測設定圖檔中") dofile(Ehgy.."設定.lua") mSleep(wait1); notifyMessage("偵測執行圖檔中") dofile(Ehgy.."執行.lua") mSleep(wait1); x , y = findImageFuzzy(image.."設定.bmp", 90); mSleep(1500); touchDown(0, x+set_x, y+set_y); touchUp(0); mSleep(wait1); notifyMessage("偵測取消圖檔中") dofile(Ehgy.."取消.lua") mSleep(wait1); 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("偵測執行中圖檔中") dofile(Ehgy.."執行中.lua") mSleep(wait1); mSleep(5000); end --偵測戰鬥圖檔 --執行戰鬥判定 dofile(Touchelper .. "3_戰鬥及狀態判定.lua") --判定背包是否上限 mSleep(2000); while true do x1 = findColorInRegionFuzzy(0x706F6D, 99, 390*w+set_x, 575*h+set_y, 690*w+set_x, 625*h+set_y); y1 = findColorInRegionFuzzy(0x125C65, 99, 420*w+set_x, 1220*h+set_y, 470*w+set_x, 1240*h+set_y); if x1 == -1 and y1 ~= -1 then mSleep(wait1); notifyVoice("/sdcard/0/OV.wav") notifyMessage("背包以抵達上限") mSleep(wait1); notifyVoice("/sdcard/0/OV.wav") notifyMessage("背包以抵達上限") os.exit() else notifyMessage("關卡已結束重新選關中") mSleep(wait1); goto A end --判定背包是否上限 end--Fauto end--main |