From 20b9f43133698a4f6ccd1935c39a3c9188c2f1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BA=81=E5=8A=A8=E7=9A=84=E5=B0=8F=E6=B0=A8=E6=B0=94?= Date: Mon, 12 Jan 2026 16:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=98=E6=A1=A3=E5=88=A0?= =?UTF-8?q?=E9=99=A4=20(#2664)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/WeeklyThousandStarRealm/README.md | 2 +- repo/js/WeeklyThousandStarRealm/main.js | 75 +++++++++++++++---- repo/js/WeeklyThousandStarRealm/manifest.json | 4 +- repo/js/WeeklyThousandStarRealm/settings.json | 2 +- 4 files changed, 63 insertions(+), 20 deletions(-) diff --git a/repo/js/WeeklyThousandStarRealm/README.md b/repo/js/WeeklyThousandStarRealm/README.md index 12219c7f4..d10ccc890 100644 --- a/repo/js/WeeklyThousandStarRealm/README.md +++ b/repo/js/WeeklyThousandStarRealm/README.md @@ -1,6 +1,6 @@ # 🌌 千星奇域 · 成就经验自动刷取脚本 -**⚠️ 提醒:成就模式所需的地图定制化程度较高,如默认地图被下架不方便替换,请使用非成就模式刷取固定 20 经验的关卡😇** +**⚠️ 提醒:目前暂不需要自己找图,成就模式所需的地图定制化程度较高,如默认地图被下架不方便替换,请使用非成就模式刷取固定 20 经验的关卡😇** > 成就模式所需地图要求:时间较长 + 能自动结算 + 有成就(必要) diff --git a/repo/js/WeeklyThousandStarRealm/main.js b/repo/js/WeeklyThousandStarRealm/main.js index 08f46c2b4..bd034f8f9 100644 --- a/repo/js/WeeklyThousandStarRealm/main.js +++ b/repo/js/WeeklyThousandStarRealm/main.js @@ -171,25 +171,68 @@ async function findImageAndClick(path, x, y, w, h, imgAttempts = attempts) { } } +// 查找要删除的存档 +async function findSaveInList(keyword) { + const maxScroll = 15; + + for (let i = 0; i < maxScroll; i++) { + const region = await findText( + keyword, + 200, 250, 1500, 700, + 1 + ); + + if (region) { + return region; + } + + // 向下滚动 + moveMouseTo(1800, 500); + await sleep(100); + await mouseScrollDown(400); + await sleep(500); + } + + return null; +} + // 清除游玩数据 async function deleteSource() { - if (achievementMode) { - await sleep(duration); - await genshin.returnMainUi(); - log.info("开始清除地图数据"); - await sleep(duration); - keyPress("VK_B"); - await sleep(duration); - await findTextAndClick("管理关卡", 960, 0, 960, 100); - await findTextAndClick("管理", 960, 980, 960, 100); - await findImageAndClick("check_box", 0, 0, 1480, 340); - await findTextAndClick("删除",960, 980, 960, 100); - await findTextAndClick("确认", 960, 600, 960, 400); - await findTextAndClick("确认", 960, 600, 960, 400); - log.info("数据清除完成"); - await sleep(duration); + if (!achievementMode) return; + + await genshin.returnMainUi(); + log.info("开始自动删除关卡存档"); + await sleep(duration); + + // 打开奇域收藏 + keyPress("VK_B"); + await sleep(duration); + + await findTextAndClick("管理关卡", 960, 0, 960, 100); + await findTextAndClick("管理", 960, 980, 960, 100); + + // 查找目标存档 + const saveRegion = await findSaveInList(starRoomName); + if (!saveRegion) { + log.warn("未找到目标存档,跳过删除"); await genshin.returnMainUi(); + return; } + + // 计算复选框位置 + const sy = saveRegion.y - 30; + + await sleep(300); + await findImageAndClick("check_box", 0, sy, 1480, saveRegion.height + 70); + // 删除 + await sleep(duration); + await findTextAndClick("删除", 960, 980, 960, 100); + await findTextAndClick("确认", 960, 600, 960, 400); + await findTextAndClick("确认", 960, 600, 960, 400); + + log.info("关卡存档删除完成"); + await sleep(duration); + await genshin.returnMainUi(); } // 进入千星奇域的全部奇域页面 @@ -316,7 +359,7 @@ async function playMap() { } let firstOutputCount = 0; while (true) { - const whiteText = await findText("空白处", 610, 950, 700, 60, 1); + const whiteText = await findText("空白", 610, 900, 700, 100, 1); if (whiteText) { await sleep(duration); click(610, 950); diff --git a/repo/js/WeeklyThousandStarRealm/manifest.json b/repo/js/WeeklyThousandStarRealm/manifest.json index 87ab33419..ae25d5eef 100644 --- a/repo/js/WeeklyThousandStarRealm/manifest.json +++ b/repo/js/WeeklyThousandStarRealm/manifest.json @@ -1,9 +1,9 @@ { "manifest_version": 1, "name": "千星奇域每周成就经验刷取", - "version": "2.3", + "version": "2.4", "bgi_version": "0.54.0", - "description": "可用于利用成就高经验值刷取经验,默认配置每周刷满需要24分钟", + "description": "无需自己找图,可用于利用成就高经验值刷取经验,默认配置每周刷满需要24分钟", "authors": [ { "name": "躁动的氨气", diff --git a/repo/js/WeeklyThousandStarRealm/settings.json b/repo/js/WeeklyThousandStarRealm/settings.json index 2c5ec4e20..a5f243611 100644 --- a/repo/js/WeeklyThousandStarRealm/settings.json +++ b/repo/js/WeeklyThousandStarRealm/settings.json @@ -26,7 +26,7 @@ { "type": "input-text", "name": "starRoomName", - "label": "收藏模式所使用的地图名称(不是房间ID,是地图名字)\n请确保收藏模式的开关已开启", + "label": "使用的地图名称(不是房间ID,是地图名字)", "default": "碰碰墙" }, {