From 41909bbf9fd42cc3221e3d30200928992f9f2db7 Mon Sep 17 00:00:00 2001 From: 5117600049 <511760049@qq.com> Date: Mon, 12 May 2025 11:45:45 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=84=9A=E6=9C=AC=EF=BC=9A=E6=89=93=E7=89=8C?= =?UTF-8?q?=E4=B8=80=E6=9D=A1=E9=BE=99BUG=E4=BF=AE=E5=A4=8D=20(#790)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update main.js * Update manifest.json --- repo/js/七圣召唤七日历练全自动/main.js | 34 +++++++++++++++----- repo/js/七圣召唤七日历练全自动/manifest.json | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/repo/js/七圣召唤七日历练全自动/main.js b/repo/js/七圣召唤七日历练全自动/main.js index d66d91e6..0c86befd 100644 --- a/repo/js/七圣召唤七日历练全自动/main.js +++ b/repo/js/七圣召唤七日历练全自动/main.js @@ -8,8 +8,7 @@ async function checkChallengeResults() { const region1 = RecognitionObject.ocr(785, 890, 340, 82);// 对话区域 let capture = captureGameRegion(); let res1 = capture.find(region1); - - if (1){ + if (res1.isEmpty()){ await sleep(1000); click(960, 540); await sleep(500); @@ -25,16 +24,23 @@ async function checkChallengeResults() { await sleep(1000); return; } - + else{ + await sleep(1000); + click(754,915 );//退出挑战 + await sleep(4000); + await autoConversation(); + await sleep(1000); + return; + } } //自动对话,直到出现选项框 await autoConversation(); -async function autoConversation() { +async function autoConversation() { + await sleep(2000);//点击后等待一段时间避免误判 const region1 = RecognitionObject.ocr(785, 890, 340, 82);// 对话区域 const region2 = RecognitionObject.ocr(1250, 400, 660, 440);// 选项区域 let talkTime = 0; - await sleep(2000);//点击后等待一段时间避免误判 //最多10次对话 while (talkTime < 20) { let capture = captureGameRegion(); @@ -43,15 +49,19 @@ async function autoConversation() { if (!res1.isEmpty() && res2.isEmpty()){ talkTime++; keyPress("VK_SPACE"); - await sleep(1500); + await sleep(500); + keyPress("VK_SPACE"); + await sleep(500); } else if(!res1.isEmpty() && !res2.isEmpty()){ keyPress("F"); + await sleep(1000); log.info("已选择谈话内容"); return; } else if(res1.isEmpty() && !res2.isEmpty()){ log.info("谈话完成"); + await sleep(1000); return; } talkTime++; @@ -64,7 +74,7 @@ async function autoConversation() { async function tpEndDetection() { const region = RecognitionObject.ocr(1690, 230, 75, 350);// 队伍名称区域 let tpTime = 0; - await sleep(1500);//点击传送后等待一段时间避免误判 + await sleep(500);//点击传送后等待一段时间避免误判 //最多30秒传送时间 while (tpTime < 300) { let capture = captureGameRegion(); @@ -209,6 +219,12 @@ async function captureAndStoreTexts() { //检查是否有对应的挑战对手 async function searchAndClickTexts() { + middleButtonClick(); + await sleep(800); + moveMouseBy(0, 1030); + await sleep(800); + moveMouseBy(0, 1030); + await sleep(800); // 限定区域坐标和大小 const searchX = 1210; const searchY = 440; @@ -298,6 +314,8 @@ await tpEndDetection(); //函数:对话和打牌 async function Playcards() { +await sleep(800);//略微俯视,避免名字出现在选项框附近,导致错误点击 +moveMouseBy(0, 1030); await sleep(1000); await autoConversation(); log.info("对话完成"); @@ -324,7 +342,7 @@ keyDown("w"); await sleep(1200); keyUp("d"); keyUp("w"); -await sleep(600); +await sleep(700); } //前往二号桌 async function gotoTable2() { diff --git a/repo/js/七圣召唤七日历练全自动/manifest.json b/repo/js/七圣召唤七日历练全自动/manifest.json index 9c95af8b..2fd3f03d 100644 --- a/repo/js/七圣召唤七日历练全自动/manifest.json +++ b/repo/js/七圣召唤七日历练全自动/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "打牌一条龙", - "version": "1.6", + "version": "1.8", "description": "只靠一个牌组的话,胜率还是太低了,所以有没有既简单又强势的卡组推荐下呢?", "authors": [ {