diff --git a/repo/js/AutoSereniteaPot/main.js b/repo/js/AutoSereniteaPot/main.js index 86ca5d70..5b0a0aad 100644 --- a/repo/js/AutoSereniteaPot/main.js +++ b/repo/js/AutoSereniteaPot/main.js @@ -18,11 +18,24 @@ async function main() { // 进入尘歌壶,等待加载动画 keyPress("F"); - let waitTime = settings.loadingWaitTime; - if (!waitTime) { - waitTime = 10; + // 先等待5秒,应该不会比这快 + await sleep(5000); + // 等待传送完成 + let isEntering = true; + while (isEntering) { + // 截图检测传送状态 + let screen = captureGameRegion(); + let targetRegion = screen.DeriveCrop(85, 1025, 69, 28); + let ocrRo = RecognitionObject.Ocr(0, 0, targetRegion.Width, targetRegion.Height); + let ocrResult = targetRegion.find(ocrRo); + if (ocrResult.Text.toLowerCase().includes("enter")) { + isEntering = false; + } + await sleep(1000); } - await sleep(waitTime * 1000); + + // 进入尘歌壶以后,等待1秒 + await sleep(1000); // 移动到阿圆 await moveToAYuan(); @@ -33,7 +46,7 @@ async function main() { await sleep(2000); // 点击屏幕中间跳过对话 click(960, 540); - await sleep(1000); + await sleep(2000); // 点击“信任等阶” click(1370, 432) await sleep(1000); @@ -60,7 +73,6 @@ async function main() { } async function findSereniteaPot() { - let found = false; let currentX = 178; // 起始X坐标 let searchCount = 0; // 添加查找次数计数器 const MAX_SEARCH_COUNT = 5; // 最大查找次数 @@ -82,7 +94,6 @@ async function findSereniteaPot() { let ocrResult = targetRegion.find(ocrRo); if (!ocrResult.isEmpty() && ocrResult.Text.includes("尘歌壶")) { - found = true; // 点击指定坐标 click(1690, 1020); await sleep(1000); @@ -130,4 +141,4 @@ async function moveToAYuan() { } } -main(); \ No newline at end of file +main(); diff --git a/repo/js/AutoSereniteaPot/manifest.json b/repo/js/AutoSereniteaPot/manifest.json index f71578f8..2a9d92e3 100644 --- a/repo/js/AutoSereniteaPot/manifest.json +++ b/repo/js/AutoSereniteaPot/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "尘歌壶一条龙-领取洞天宝钱和角色好感", - "version": "0.0.1", + "version": "0.0.2", "description": "自动放置并进入尘歌壶,寻找阿圆,领取洞天宝钱和好感(需要配置进入尘歌壶以后的路线)(更新时间:5.5版本)", "authors": [ { @@ -11,4 +11,4 @@ ], "settings_ui": "settings.json", "main": "main.js" -} \ No newline at end of file +} diff --git a/repo/js/AutoSereniteaPot/settings.json b/repo/js/AutoSereniteaPot/settings.json index 63295379..3f356f86 100644 --- a/repo/js/AutoSereniteaPot/settings.json +++ b/repo/js/AutoSereniteaPot/settings.json @@ -3,10 +3,5 @@ "name": "route", "type": "input-text", "label": "进入尘歌壶以后寻找阿圆的路径\n填写规则:方向键+空格+时间(单位:毫秒)\n多个路径用英文逗号隔开,例如:A 1000,S 1500,A 500" - }, - { - "name": "loadingWaitTime", - "type": "input-text", - "label": "按 F 进入尘歌壶后等待加载的时间(单位:秒)(默认:10)" } -] \ No newline at end of file +]