js:自动狗粮修复 (#1043)

* js:自动狗粮修复

* js:自动狗粮修复(1)
This commit is contained in:
mno
2025-06-09 15:16:13 +08:00
committed by GitHub
parent 313d285b1c
commit e320259653
3 changed files with 11 additions and 5 deletions

View File

@@ -129,6 +129,8 @@
## 更新日志
### 1.222025.06.09
1.修复了狗粮路线不运行的bug
### 1.212025.06.09
1. 修改盗宝团触发路线,减少摩拉丢失
2.优化ocr模块现在识别失败时会尝试点击中心位置

View File

@@ -205,6 +205,7 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120;
// 启用自动拾取的实时任务
dispatcher.addTimer(new RealtimeTimer("AutoPick"));
let runnedTimes = 0;
wait: {
if (runnedToday) {
@@ -239,7 +240,7 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120;
const fightTimeout = validateTimeoutSetting(settings.fightTimeout, DEFAULT_FIGHT_TIMEOUT_SECONDS, "战斗");
// 好感循环开始
const runnedTimes = await AutoFriendshipDev(50, ocrTimeout, fightTimeout, enemyType, endTime);
runnedTimes = await AutoFriendshipDev(50, ocrTimeout, fightTimeout, enemyType, endTime);
}
}
@@ -595,6 +596,7 @@ async function AutoPath(locationName) {
//好感度任务的逻辑
async function AutoFriendshipDev(times, ocrTimeout, fightTimeout, enemyType = "盗宝团", endTime) {
let friendTimes = 0;
for (let i = 0; i < times; i++) {
// 获取当前时间
@@ -607,7 +609,7 @@ async function AutoFriendshipDev(times, ocrTimeout, fightTimeout, enemyType = "
}
await fakeLog(`${i + 1}次好感`, false, true, 0);
friendTimes = friendTimes + 1;
await AutoPath(`${enemyType}-触发点`);
// 启动路径导航任务
let pathTaskPromise = AutoPath(`${enemyType}-战斗点`);
@@ -709,7 +711,7 @@ async function AutoFriendshipDev(times, ocrTimeout, fightTimeout, enemyType = "
log.info(`${enemyType}好感运行了${i + 1}`);
await genshin.tpToStatueOfTheSeven();
return i + 1;
return friendTimes;
}
// 验证输入是否是正整数
@@ -1132,9 +1134,11 @@ async function decomposeArtifacts(keep4Star, doDecompose) {
if (settings.keep4Star) {
log.info(`保留的四星数量: ${fourStarNum}`);
}
const resultExperience = resinExperience + (settings.keep4Star ? 2520 * fourStarNum : 0);
log.info(`计入四星的经验: ${resultExperience}`);
const result = {
mora: recognizedText, // 将 recognizedText 赋值给 mora
artifactExperience: resinExperience + 2520 * fourStarNum // 计算并赋值给 artifactExperience
artifactExperience: resultExperience
};
await genshin.returnMainUi();
return result;

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "自动狗粮重制版",
"version": "1.21",
"version": "1.22.1",
"tags": ["好感", "盗宝团", "愚人众", "鳄鱼", "兽肉", "狗粮"],
"description": "通过不同好感任务卡时间后运行狗粮任务以提高狗粮总收益,需要正确配置好感队伍的战斗策略,并在自定义配置中指定好感和狗粮队伍名称",
"authors": [