From a49404d1bb27377390d976b018363448888ca26f Mon Sep 17 00:00:00 2001 From: xoipz <85264015+xoipz@users.noreply.github.com> Date: Mon, 14 Jul 2025 00:13:01 +0800 Subject: [PATCH] =?UTF-8?q?js:=20=E6=AF=8F=E6=97=A5=E5=A7=94=E6=89=98=200.?= =?UTF-8?q?98.2=20(#1342)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/AutoCommission/README.md | 19 ++++- .../钥匙是易丢品/晨曦酒庄/process.json | 40 ++++++++- .../钥匙是易丢品/达达乌帕谷/process.json | 8 ++ .../process/餐品订单/蒙德城/process.json | 5 ++ .../process/餐品订单/蒙德城/餐品订单-5.json | 2 +- .../鸽子鸭子小孩子/坠星山谷/process.json | 26 ++---- .../assets/临危受命/千风神殿-1.json | 49 +++++++---- .../assets/临危受命/达达乌帕谷-2.json | 37 ++++++--- .../assets/临危受命/风龙废墟-1.json | 6 +- repo/js/AutoCommission/main.js | 82 +++++++++++++++---- repo/js/AutoCommission/manifest.json | 4 +- 11 files changed, 203 insertions(+), 75 deletions(-) diff --git a/repo/js/AutoCommission/README.md b/repo/js/AutoCommission/README.md index 05566f43..34e1f6f0 100644 --- a/repo/js/AutoCommission/README.md +++ b/repo/js/AutoCommission/README.md @@ -12,8 +12,20 @@ ## 更新日志 -### 当前版本:0.98 -- 大更 +### 当前版本:0.98.2 + +**重大功能更新** + +- ✨ **新增角色识别系统** - 支持83+角色头像识别,包含完整角色数据库和别名系统 +- 🎮 **队伍配置界面优化** - 新增队伍配置、角色加入/更换等界面识别图标 +- 📝 **大幅扩展对话委托** - 新增8个对话委托:中度冰寒、冒险就要勇于前进、圆滚滚的大团骚乱、报答神明的方式、永不停歇的风与米歇尔小姐、落叶归风、蒙德酒客、触不可及的恋人 +- ⚔️ **战斗委托增强** - 新增危险运输现象战斗委托,语言交流扩展至风龙废墟地区 +- 🔧 **技术优化** - 改进OCR识别准确性,优化代码结构,新增问号委托图标识别 +- 📊 **委托覆盖率提升** - 从原有基础委托大幅扩展到20+个委托支持 + +### 当前版本:0.98.2 +- 修复已知问题 +- 完成了更多对话委托 ### 上一版本:0.97 - 修复已知问题 @@ -64,8 +76,9 @@ 3. 常见问题:1.Q:明明这个地方没有委托,却跑回去打怪(此问题已经解决)。A:未来会增加检测功能,优化脚本。2.Q:为什么有的蒙德打怪委托未完成?A:因为请将脚本data/文件夹下面的数据,log/日志下今日日志,每日委托任务截图。反馈给作者 ## 反馈方法 -- 1.加群1053392753反馈 +- 1.加QQ群1053392753反馈 - 2.发送截图,日志给3302871403@qq.com +- 3.BGI QQ频道@星野 ## 注意事项 - 部分委托可能无法正确识别或追踪,遇到问题请手动完成 diff --git a/repo/js/AutoCommission/assets/process/钥匙是易丢品/晨曦酒庄/process.json b/repo/js/AutoCommission/assets/process/钥匙是易丢品/晨曦酒庄/process.json index 01daf6ca..8928bb62 100644 --- a/repo/js/AutoCommission/assets/process/钥匙是易丢品/晨曦酒庄/process.json +++ b/repo/js/AutoCommission/assets/process/钥匙是易丢品/晨曦酒庄/process.json @@ -1,4 +1,36 @@ -钥匙是易丢物品-晨曦酒庄-1.json -F -钥匙是易丢物品-晨曦酒庄-2.json -F \ No newline at end of file +[ +{ + "type": "自动任务", + "data": { + "action": "enable", + "taskType": "AutoPick" + }, + "note": "启用自动拾取" +}, + { + "type": "地图追踪", + "data": "钥匙是易丢物品-晨曦酒庄-1.json", + "note": "执行第一个地图追踪步骤" + }, + { + "type": "对话", + "data": { + "skipCount": 3, + "npcWhiteList": ["怀尔德"] + }, + "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" + }, + { + "type": "地图追踪", + "data": "钥匙是易丢物品-晨曦酒庄-2.json", + "note": "执行第一个地图追踪步骤" + }, + { + "type": "对话", + "data": { + "skipCount": 3, + "npcWhiteList": ["怀尔德"] + }, + "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" + } +] \ No newline at end of file diff --git a/repo/js/AutoCommission/assets/process/钥匙是易丢品/达达乌帕谷/process.json b/repo/js/AutoCommission/assets/process/钥匙是易丢品/达达乌帕谷/process.json index 9b95e812..e524369f 100644 --- a/repo/js/AutoCommission/assets/process/钥匙是易丢品/达达乌帕谷/process.json +++ b/repo/js/AutoCommission/assets/process/钥匙是易丢品/达达乌帕谷/process.json @@ -1,4 +1,12 @@ [ +{ + "type": "自动任务", + "data": { + "action": "enable", + "taskType": "AutoPick" + }, + "note": "启用自动拾取" +}, { "type": "地图追踪", "data": "钥匙是易丢品-达达乌帕谷-1.json", diff --git a/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/process.json b/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/process.json index 68d1e0a0..0e940759 100644 --- a/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/process.json +++ b/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/process.json @@ -18,6 +18,11 @@ }, "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" }, +{ + "type": "等待", + "data": 10000, + "note": "等待10秒钟" +}, { "type": "委托描述检测", "data": "取得制作好的餐品", diff --git a/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/餐品订单-5.json b/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/餐品订单-5.json index 25291130..68c45484 100644 --- a/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/餐品订单-5.json +++ b/repo/js/AutoCommission/assets/process/餐品订单/蒙德城/餐品订单-5.json @@ -13,7 +13,7 @@ "id": 1, "x": -880.248046875, "y": 1857.73388671875, - "type": "path", + "type": "teleport", "move_mode": "walk", "action": "", "action_params": "" diff --git a/repo/js/AutoCommission/assets/process/鸽子鸭子小孩子/坠星山谷/process.json b/repo/js/AutoCommission/assets/process/鸽子鸭子小孩子/坠星山谷/process.json index a6325bb6..4d9c61b7 100644 --- a/repo/js/AutoCommission/assets/process/鸽子鸭子小孩子/坠星山谷/process.json +++ b/repo/js/AutoCommission/assets/process/鸽子鸭子小孩子/坠星山谷/process.json @@ -6,24 +6,17 @@ json "note": "执行第一个地图追踪步骤" }, { - "type": "按键", - "data": "F", - "note": "按下F键" + "type": "对话", + "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" }, { - "type": "按键", - "data": "F", - "note": "按下F键" - }, - { - "type": "按键", - "data": "F", - "note": "按下F键" + "type": "对话", + "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" }, { "type": "地图追踪", "data": "鸽子、鸭子、小孩子-坠星山谷-2.json", - "note": "执行第一个地图追踪步骤" + "note": "执行第二个地图追踪步骤" }, { "type": "按键", @@ -32,12 +25,11 @@ json }, { "type": "地图追踪", - "data": "鸽子、鸭子、小孩子-坠星山谷-3.json", - "note": "执行第一个地图追踪步骤" + "data": "鸽子、鸭子、小孩子-坠星山谷-1.json", + "note": "执行第三个地图追踪步骤" }, { - "type": "按键", - "data": "F", - "note": "按下F键" + "type": "对话", + "note": "执行对话步骤,优先选择特定选项并与白名单NPC交互" } ] diff --git a/repo/js/AutoCommission/assets/临危受命/千风神殿-1.json b/repo/js/AutoCommission/assets/临危受命/千风神殿-1.json index 69567886..3483d975 100644 --- a/repo/js/AutoCommission/assets/临危受命/千风神殿-1.json +++ b/repo/js/AutoCommission/assets/临危受命/千风神殿-1.json @@ -2,44 +2,59 @@ "info": { "name": "千风神殿-1", "type": "collect", - "author": "1", + "author": "星野", "version": "1.0", "description": "", - "bgi_version": "0.42.0" + "map_name": "Teyvat", + "bgi_version": "0.45.0", + "tags": [], + "last_modified_time": 1752311953828 }, "positions": [ { "id": 1, - "x": -1498.7, - "y": 2265.75, + "x": -1506.6298828125, + "y": 2296.187744140625, + "type": "teleport", + "move_mode": "dash", "action": "", - "move_mode": "walk", - "type": "teleport" + "action_params": "" }, { "id": 2, - "x": -1543.68, - "y": 2222.5, + "x": -1527.3056640625, + "y": 2276.61669921875, + "type": "path", + "move_mode": "dash", "action": "", - "move_mode": "walk", - "type": "path" + "action_params": "" }, { "id": 3, - "x": -1564.87, - "y": 2221.31, + "x": -1536.4150390625, + "y": 2260.99462890625, "type": "path", - "move_mode": "run", + "move_mode": "walk", "action": "", "action_params": "" }, { "id": 4, - "x": -1578.92, - "y": 2236.75, + "x": -1547.005859375, + "y": 2247.629150390625, + "type": "path", + "move_mode": "dash", + "action": "", + "action_params": "" + }, + { + "id": 5, + "x": -1577.7724609375, + "y": 2238.30224609375, + "type": "path", + "move_mode": "dash", "action": "fight", - "move_mode": "walk", - "type": "path" + "action_params": "" } ] } \ No newline at end of file diff --git a/repo/js/AutoCommission/assets/临危受命/达达乌帕谷-2.json b/repo/js/AutoCommission/assets/临危受命/达达乌帕谷-2.json index 6e099c81..d749c465 100644 --- a/repo/js/AutoCommission/assets/临危受命/达达乌帕谷-2.json +++ b/repo/js/AutoCommission/assets/临危受命/达达乌帕谷-2.json @@ -2,10 +2,13 @@ "info": { "name": "达达乌帕谷-2", "type": "collect", - "author": "1", + "author": "星野", "version": "1.0", "description": "", - "bgi_version": "0.42.3" + "map_name": "Teyvat", + "bgi_version": "0.45.0", + "tags": [], + "last_modified_time": 1752312906100 }, "positions": [ { @@ -28,8 +31,8 @@ }, { "id": 3, - "x": -1614.0, - "y": 1354.88, + "x": -1614, + "y": 1354.880000000001, "action": "", "move_mode": "dash", "action_params": "", @@ -37,8 +40,8 @@ }, { "id": 4, - "x": -1632.81, - "y": 1355.0, + "x": -1632.8099999999995, + "y": 1355, "action": "", "move_mode": "run", "action_params": "", @@ -46,7 +49,7 @@ }, { "id": 5, - "x": -1649.0, + "x": -1649, "y": 1357.5, "action": "", "move_mode": "dash", @@ -64,7 +67,7 @@ }, { "id": 7, - "x": -1679.06, + "x": -1679.0599999999995, "y": 1338.75, "action": "", "move_mode": "dash", @@ -73,12 +76,22 @@ }, { "id": 8, - "x": -1687.37, - "y": 1262.62, - "action": "fight", - "move_mode": "walk", + "x": -1676.5, + "y": 1298, + "action": "", + "move_mode": "dash", "action_params": "", "type": "path" + }, + { + "id": 9, + "x": -1687.369999999999, + "y": 1262.619999999999, + "action": "fight", + "move_mode": "dash", + "action_params": "", + "type": "path", + "locked": false } ] } \ No newline at end of file diff --git a/repo/js/AutoCommission/assets/临危受命/风龙废墟-1.json b/repo/js/AutoCommission/assets/临危受命/风龙废墟-1.json index b5aeb87c..cf752b79 100644 --- a/repo/js/AutoCommission/assets/临危受命/风龙废墟-1.json +++ b/repo/js/AutoCommission/assets/临危受命/风龙废墟-1.json @@ -11,7 +11,7 @@ { "id": 1, "action": "", - "move_mode": "walk", + "move_mode": "dash", "type": "teleport", "x": -89.55, "y": 2780.75, @@ -20,7 +20,7 @@ { "id": 2, "action": "", - "move_mode": "walk", + "move_mode": "dash", "type": "path", "x": -86.3, "y": 2744.25, @@ -29,7 +29,7 @@ { "id": 3, "action": "fight", - "move_mode": "walk", + "move_mode": "dash", "type": "path", "x": -95.29, "y": 2748.75, diff --git a/repo/js/AutoCommission/main.js b/repo/js/AutoCommission/main.js index 1b04d031..fcf7707d 100644 --- a/repo/js/AutoCommission/main.js +++ b/repo/js/AutoCommission/main.js @@ -1,7 +1,7 @@ (async function () { // 版本和编译信息 - const VERSION = "0.98.1"; - const BUILD_TIME = "2025.07.11"; + const VERSION = "0.98.2"; + const BUILD_TIME = "2025.07.13"; async function errorlog() { // 输出版本和编译时间信息 log.info("=".repeat(20)); @@ -159,7 +159,7 @@ async function errorlog() { skipCommissions, }; - log.info("setting:{index}", result); + log.debug("setting:{index}", result); return result; } catch { @@ -552,9 +552,6 @@ async function errorlog() { // 根据委托类型执行不同的处理逻辑 if (commission.type === Datas.COMMISSION_TYPE.TALK) { - dispatcher.addTimer( - new RealtimeTimer("AutoPick", { forceInteraction: false }) - ); // 执行对话委托 const talkSuccess = await Execute.executeTalkCommission( commission.name, @@ -1127,6 +1124,53 @@ async function errorlog() { return false; } }, + + // 处理自动任务步骤 + processAutoTask: async (step) => { + try { + const { action, taskType, config } = step.data; + + if (!action) { + log.error("自动任务参数不完整,需要 action 参数"); + return false; + } + + log.info("执行自动任务操作: {action}", action); + + switch (action) { + case "enable": + // 启用自动任务 + if (!taskType) { + log.error("启用自动任务需要指定 taskType"); + return false; + } + + if (config && typeof config === "object") { + log.info("启用自动任务: {type},配置: {config}", taskType, JSON.stringify(config)); + dispatcher.addTimer(new RealtimeTimer(taskType, config)); + } else { + log.info("启用自动任务: {type}", taskType); + dispatcher.addTimer(new RealtimeTimer(taskType)); + } + break; + + case "disable": + // 取消所有自动任务 + log.info("取消所有自动任务"); + dispatcher.ClearAllTriggers(); + break; + + default: + log.error("未知的自动任务操作: {action}", action); + return false; + } + + return true; + } catch (error) { + log.error("处理自动任务步骤时出错: {error}", error.message); + return false; + } + }, }; // 步骤处理器工厂 - 更好的扩展性设计 @@ -1143,7 +1187,9 @@ async function errorlog() { }, 等待: async (step, context) => { - await sleep(5000); + const waitTime = step.data || 5000; + log.info("等待 {time} 毫秒", waitTime); + await sleep(waitTime); }, 追踪委托: async (step, context) => { @@ -1202,6 +1248,10 @@ async function errorlog() { 切换角色: async (step, context) => { await StepProcessor.processSwitchRole(step); }, + + 自动任务: async (step, context) => { + await StepProcessor.processAutoTask(step); + }, }, // 注册新的步骤处理器 @@ -1388,13 +1438,13 @@ async function errorlog() { // 正常跳过对话 await genshin.chooseTalkOption("纳西妲美貌举世无双", skipCount, false); - keyPress("VK_ESCAPE");//关弹窗 - if (isInMainUI()) { log.info("检测到已返回主界面,结束循环"); break; } + //keyPress("VK_ESCAPE");//关弹窗 + // 每skipCount次跳过后,进行OCR识别 if (true) { // 检查是否有匹配的优先选项 @@ -1488,8 +1538,8 @@ async function errorlog() { await sleep(1000); - // 使用Main_Dev识别前3个委托 - log.info("findCommissionTarget使用Main_Dev识别前3个委托"); + // 识别前3个委托 + log.debug("findCommissionTarget识别前3个委托"); // 先识别前3个Main_Dev区域(索引0-2) for (let regionIndex = 0; regionIndex < 3; regionIndex++) { @@ -2138,7 +2188,7 @@ async function errorlog() { } }, - // 识别委托列表 - 使用Main_Dev进行4个单独识别 + // 识别委托列表 - 进行4个单独识别 recognizeCommissions: async (supportedCommissions) => { try { log.info("开始执行委托识别"); @@ -2146,12 +2196,12 @@ async function errorlog() { // 初始化当前委托位置变量 let currentCommissionPosition = null; - // 步骤1: 使用Main_Dev识别前3个委托(索引0-2) - log.info("步骤1: 使用Main_Dev识别前3个委托"); + // 步骤1: 识别前3个委托(索引0-2) + log.info("步骤1: 使用识别前3个委托"); let allCommissions = []; - // 先识别前3个Main_Dev区域(索引0-2) + // 先识别前3个区域(索引0-2) for (let regionIndex = 0; regionIndex < 3; regionIndex++) { const region = Datas.OCR_REGIONS.Main_Dev[regionIndex]; @@ -2341,7 +2391,7 @@ async function errorlog() { log.info("步骤3: 翻页后识别第4个委托"); await UI.pageScroll(1); - // 识别第4个Main_Dev区域(索引3) + // 识别第4个区域(索引3) const region = Datas.OCR_REGIONS.Main_Dev[3]; let fourthCommission = null; diff --git a/repo/js/AutoCommission/manifest.json b/repo/js/AutoCommission/manifest.json index eb1e525d..3b1c401a 100644 --- a/repo/js/AutoCommission/manifest.json +++ b/repo/js/AutoCommission/manifest.json @@ -1,9 +1,9 @@ { "manifest_version": 1, "name": "(对话+成就)全自动蒙德地区每日委托", - "version": "0.98.1", + "version": "0.98.2", "tags": ["委托","对话","战斗","成就","历练点"], - "description": "自动完成每日委托、自动识别委托内容、自动追踪战斗委托、自动完成对话委托、自动获得到隐藏成就。使用前请阅读README.md(可用记事本打开)获取详细说明和常见问题解答。目前项目正处于开发阶段急需人手,有意者可加群1053392753(会启动js,发送文件即可)。每天只需花 5 ~ 10 分钟做一个蒙德城对话委托记下坐标,就当是顺路补下成就。感谢云闲vsv & 换苏伟u & 小鹰划船不用桨 & 塔台的共同开发", + "description": "自动完成每日委托、自动识别委托内容、自动追踪战斗委托、自动完成对话委托、自动获得到隐藏成就。使用前请阅读README.md获取详细说明和常见问题解答。目前项目正处于开发阶段急需人手,有意者可加群。每天只需花 5 ~ 10 分钟做一个蒙德委托记下坐标,就当是顺路补下成就。感谢云闲vsv & 换苏伟u & 小鹰划船不用桨 & 塔台 &@未知_ 的共同开发", "authors": [ { "name": "星野",