From 200ac5d6c205cd906ebe6ef9f7f5452c2eace335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E7=B4=AB=E7=83=9Fowo?= <1532270678@qq.com> Date: Thu, 9 Oct 2025 00:46:55 +0800 Subject: [PATCH] =?UTF-8?q?AutoMonday=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20(#2103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复了record文件更新后丢失的问题 2. 修复了偶现的质变仪无法使用的问题 3. 添加了质变仪和爱可菲的法器角色充能功能,电气水晶被开采后也不用担心了! --- repo/js/AutoMonday/README.md | 6 +++- repo/js/AutoMonday/main.js | 52 ++++++++++++++++++++++++++++---- repo/js/AutoMonday/manifest.json | 4 ++- repo/js/AutoMonday/settings.json | 10 ++++++ 4 files changed, 64 insertions(+), 8 deletions(-) diff --git a/repo/js/AutoMonday/README.md b/repo/js/AutoMonday/README.md index 8e182320a..5a5441d0e 100644 --- a/repo/js/AutoMonday/README.md +++ b/repo/js/AutoMonday/README.md @@ -36,7 +36,11 @@ --------------------------------------------------------------------------------------------------------------------------------- ## 更新日志 -### 1.3(2025.10.07) +### 1.3(2025.10.08) +1. 修复了record文件更新后丢失的问题 +2. 修复了偶现的质变仪无法使用的问题 +3. 添加了质变仪和爱可菲的法器角色充能功能,电气水晶被开采后也不用担心了! +### 1.2.1(2025.10.07) 1. 修复了投资券功能偶现的无法使用的bug 2. 修复了质变仪功能偶现的无法使用的bug 3. 修改了运行逻辑,某处任务执行失败不再影响后续任务的执行 diff --git a/repo/js/AutoMonday/main.js b/repo/js/AutoMonday/main.js index 1850d7391..1f1c63aa8 100644 --- a/repo/js/AutoMonday/main.js +++ b/repo/js/AutoMonday/main.js @@ -180,6 +180,19 @@ } } + //判断队内角色 + async function includes(characterName) { + var avatars = getAvatars(); + for (let i = 0; i < avatars.length; i++) { + if (avatars[i] === characterName) { + await keyPress(String(i + 1)); + await sleep(1500); + return true; + } + } + return false; + } + // 等待质变仪完成提示出现。 若超时则强制结束流程。 async function waitTransformer(deployed) { var startTime = new Date(); @@ -191,6 +204,9 @@ // 质变仪判断逻辑 if (deployed) { + if (chargingMethod == "法器角色充能") { + await includes("芭芭拉"); + } while ((NowTime - startTime) < actiontime * 1000) { await textOCR("质变产生了以下物质", 0.7, 1, 0, 539, 251, 800, 425); if (result.found) { @@ -199,13 +215,27 @@ await sleep(150); break; } + if (chargingMethod == "法器角色充能") { + leftButtonClick(); + await sleep(150); + } NowTime = new Date(); } } // 厨艺机关判断逻辑 if (ifAkf) { - await AutoPath("全自动爱可菲");//厨艺机关的部署动作用路径追踪执行 + if ((chargingMethod == "电气水晶充能")) { + await AutoPath("全自动爱可菲");//厨艺机关的部署动作用路径追踪执行 + } else if (chargingMethod == "法器角色充能") { + await includes("爱可菲"); + keyDown("E"); + await sleep(1000); + keyUp("E"); + + await sleep(800); + await includes("芭芭拉"); + } while ((NowTime - startTime) < actiontime * 1000) { let result = await textOCR("获得", 0.2, 0, 3, 159, 494, 75, 44); if (result.found) { @@ -221,6 +251,10 @@ } } } + if (chargingMethod == "法器角色充能") { + leftButtonClick(); + await sleep(150); + } await sleep(50); NowTime = new Date(); } @@ -300,7 +334,7 @@ const maxRetries = 20; // 最大重试次数 let retries = 0; // 当前重试次数 while (retries < maxRetries) { - const result = await imageRecognitionEnhanced(BH, 1, 0, 0); + const result = await imageRecognitionEnhanced(BH, 1, 0, 0, 115, 115, 1155, 845); if (result.found) { await leftButtonUp(); await sleep(500); @@ -365,7 +399,7 @@ // 背包过期物品识别 async function handleExpiredItems() { - const ifGuoqi = await textOCR("物品过期", 5, 0, 0, 870, 280, 170, 40); + const ifGuoqi = await textOCR("物品过期", 1, 0, 0, 870, 280, 170, 40); if (ifGuoqi.found) { log.info("检测到过期物品,正在处理..."); await sleep(500); @@ -585,9 +619,9 @@ await sleep(1000); // 判断是否诱捕完成 - await textOCR("诱捕装置", 3, 0, 0, 0, 0, 360, 500); + const res2 = await textOCR("晶蝶诱捕装置", 1, 0, 3, 0, 0, 360, 500); - if (!result.found) { + if (!res2.found) { log.warn("诱捕未完成,不执行后续操作"); await genshin.returnMainUi(); return; @@ -661,7 +695,12 @@ } await switchPartyIfNeeded(TEAM); //切换到指定队伍 - await AutoPath("全自动质变仪"); + + if (chargingMethod == "电气水晶充能") { + await AutoPath("全自动质变仪"); + } else if (chargingMethod == "法器角色充能") { + await genshin.tp(-874.724609375, 2276.950439453125); + } const deployed = await deployTransformer();//部署质变仪 if (!deployed) { @@ -1031,6 +1070,7 @@ const ZHIBIANYI = typeof settings.ZHIBIANY === 'string' && settings.ZHIBIANYI.trim() !== '' ? settings.ZHIBIANYI : "assets/RecognitionObject/zhibian.png"; const CHA = "assets/RecognitionObject/cha.png" const ifAkf = settings.ifAkf; + const chargingMethod = settings.chargingMethod; const ifCooking = settings.ifCooking; const ifduanZao = settings.ifduanZao; const ifShouling = settings.ifShouling; diff --git a/repo/js/AutoMonday/manifest.json b/repo/js/AutoMonday/manifest.json index 3df9109e1..177077051 100644 --- a/repo/js/AutoMonday/manifest.json +++ b/repo/js/AutoMonday/manifest.json @@ -10,13 +10,15 @@ "晶蝶诱捕装置" ], "description": "全自动周常:包含纪行、晶蝶诱捕、爱可菲和参变仪等,详情见readme", - "authors": [ { "name": "江紫烟owo", "links": "https://github.com/jiangziyanowo" } ], + "saved_files": [ + "record/*.txt" + ], "settings_ui": "settings.json", "main": "main.js" } \ No newline at end of file diff --git a/repo/js/AutoMonday/settings.json b/repo/js/AutoMonday/settings.json index 2f5d5718c..5ff532507 100644 --- a/repo/js/AutoMonday/settings.json +++ b/repo/js/AutoMonday/settings.json @@ -40,6 +40,16 @@ ], "default": "薄荷" }, + { + "name": "chargingMethod", + "type": "select", + "label": "请选择质变仪&爱可菲的充能方法", + "options": [ + "电气水晶充能", + "法器角色充能" + ], + "default": "电气水晶充能" + }, { "name": "ifYB", "type": "checkbox",