js: 每日委托 0.98.2 (#1342)

This commit is contained in:
xoipz
2025-07-14 00:13:01 +08:00
committed by GitHub
parent c9f8e0baab
commit a49404d1bb
11 changed files with 203 additions and 75 deletions

View File

@@ -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频道@星野
## 注意事项
- 部分委托可能无法正确识别或追踪,遇到问题请手动完成

View File

@@ -1,4 +1,36 @@
--1.json
F
--2.json
F
[
{
"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交互"
}
]

View File

@@ -1,4 +1,12 @@
[
{
"type": "自动任务",
"data": {
"action": "enable",
"taskType": "AutoPick"
},
"note": "启用自动拾取"
},
{
"type": "地图追踪",
"data": "钥匙是易丢品-达达乌帕谷-1.json",

View File

@@ -18,6 +18,11 @@
},
"note": "执行对话步骤优先选择特定选项并与白名单NPC交互"
},
{
"type": "等待",
"data": 10000,
"note": "等待10秒钟"
},
{
"type": "委托描述检测",
"data": "取得制作好的餐品",

View File

@@ -13,7 +13,7 @@
"id": 1,
"x": -880.248046875,
"y": 1857.73388671875,
"type": "path",
"type": "teleport",
"move_mode": "walk",
"action": "",
"action_params": ""

View File

@@ -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交互"
}
]

View File

@@ -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": ""
}
]
}

View File

@@ -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
}
]
}

View File

@@ -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,

View File

@@ -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;

View File

@@ -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": "星野",