js:采集cd管理和自动狗粮更新 (#1039)

* js:自动狗粮和采集cd更新

* js:自动狗粮改为输入最低好感任务运行次数,默认10
This commit is contained in:
mno
2025-06-09 03:00:08 +08:00
committed by GitHub
parent 4c599e05ff
commit e1bfb67d89
5 changed files with 52 additions and 29 deletions

View File

@@ -16,7 +16,7 @@
使用即表示您已阅读并同意上述条款。
**Last Updated:** 2025-05-27
**Last Updated:** 2025-06-09
---
@@ -89,9 +89,9 @@
4. 02收尾超出100以外的调查点
5. 03额外不受上限影响消失
## 五、队伍配置
## 五、推荐配置
- **双风阵容**:早柚+枫原万叶/砂糖(提升移动效率
- **双风阵容**早柚+枫原万叶/砂糖(提高移速
- **迪希雅**:白天时段提供移速加成
## 六、选择建议
@@ -132,6 +132,7 @@
1. 修改盗宝团触发路线,减少摩拉丢失
2.优化ocr模块现在识别失败时会尝试点击中心位置
3.优化流程现在只有当用户勾选了不分解四星时才会两次快速选择可以节约约5秒
4.修改自定义配置现在可以输入最低好感运行次数默认10次用来保证能够完成最低的好感任务次数。
### 1.22025.06.08
1. 加入狗粮分解和经验统计功能。
2.优化逻辑已经运行完成狗粮路线时仍然可以直接执行本js来完成好感

View File

@@ -239,7 +239,7 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120;
const fightTimeout = validateTimeoutSetting(settings.fightTimeout, DEFAULT_FIGHT_TIMEOUT_SECONDS, "战斗");
// 好感循环开始
await AutoFriendshipDev(50, ocrTimeout, fightTimeout, enemyType, endTime);
const runnedTimes = await AutoFriendshipDev(50, ocrTimeout, fightTimeout, enemyType, endTime);
}
}
@@ -323,7 +323,7 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120;
//完成剩下好感
if (settings.completeRemainingFriendship) {
if (runnedTimes < settings.minTimesForFirendship) {
//切换至好感队
await switchPartyIfNeeded(friendshipPartyName);
// 验证超时设置
@@ -343,7 +343,7 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120;
await AutoPath('鳄鱼-准备');
}
// 好感循环开始
await AutoFriendshipDev(50, ocrTimeout, fightTimeout, enemyType, endTime + 24 * 60 * 60 * 1000);
await AutoFriendshipDev(settings.minTimesForFirendship - runnedTimes, ocrTimeout, fightTimeout, enemyType, endTime + 24 * 60 * 60 * 1000);
}
//伪造js开始记录
@@ -706,10 +706,10 @@ async function AutoFriendshipDev(times, ocrTimeout, fightTimeout, enemyType = "
await fakeLog(`${i + 1}次好感`, false, false, 0);
}
log.info(`${enemyType}好感已完成`);
log.info(`${enemyType}好感运行了${i + 1}`);
await genshin.tpToStatueOfTheSeven();
return true;
return i + 1;
}
// 验证输入是否是正整数
@@ -777,8 +777,9 @@ async function waitForBattleResult(timeout = 2 * 60 * 1000, enemyType = "盗宝
while (Date.now() - fightStartTime < timeout) {
try {
// 简化OCR检测只使用一个try-catch块
let result = captureGameRegion().find(RecognitionObject.ocr(850, 150, 200, 80));
let result2 = captureGameRegion().find(RecognitionObject.ocr(0, 200, 300, 300));
let captureRegion = captureGameRegion();
let result = captureRegion.find(RecognitionObject.ocr(850, 150, 200, 80));
let result2 = captureRegion.find(RecognitionObject.ocr(0, 200, 300, 300));
let text = result.text;
let text2 = result2.text;

View File

@@ -57,9 +57,9 @@
"default": "120"
},
{
"name": "completeRemainingFriendship",
"type": "checkbox",
"label": "是否在狗粮路线结束后完成剩余盗宝团好感\n【勾选后将在狗粮路线结束后继续完成剩余的好感任务】",
"default": false
"name": "minTimesForFirendship",
"type": "input-text",
"label": "好感任务最低运行次数\n【若卡时间好感次数不足该次数在狗粮结束后补齐】",
"default": "10"
}
]