From 7e800a31d7e7ae648cb5b0e7bee8e9efb3989b86 Mon Sep 17 00:00:00 2001 From: 5117600049 <511760049@qq.com> Date: Mon, 14 Apr 2025 10:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=86=9F=E7=BB=83=E5=BA=A6=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E6=8B=89=E6=BB=A1JS=E8=84=9A=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=EF=BC=9A=E8=A7=A3=E5=86=B3=E4=BA=86=E5=9C=A8=E7=83=B9=E9=A5=AA?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E7=86=9F=E7=BB=83=E5=BA=A6?= =?UTF-8?q?=E6=9C=AA=E6=BB=A1=EF=BC=8C=E9=A3=9F=E6=9D=90=E4=B8=8D=E5=A4=9F?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E9=80=80=E5=87=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#571)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update manifest.json * Update main.js * Update settings.json * Update settings.json * Update main.js --- repo/js/烹饪熟练度一键拉满/main.js | 15 ++++++++++----- repo/js/烹饪熟练度一键拉满/manifest.json | 4 ++-- repo/js/烹饪熟练度一键拉满/settings.json | 14 ++++++++++++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/repo/js/烹饪熟练度一键拉满/main.js b/repo/js/烹饪熟练度一键拉满/main.js index 21793421..f0870a29 100644 --- a/repo/js/烹饪熟练度一键拉满/main.js +++ b/repo/js/烹饪熟练度一键拉满/main.js @@ -3,10 +3,11 @@ -//OCR得到烹制时间 +//模板匹配得到烹制时间 async function getPerfectCookingWaitTime() { -let extraTime = settings.extraTime || 0; // 如果转换失败,默认 0 +let extraTime = settings.extraTime || 0; // +let threshold0 = Number(settings.threshold0) || 0.9; extraTime = extraTime+300; const checkPoints = [ {x: 741, y: 772}, // 原始点1 @@ -54,11 +55,11 @@ extraTime = extraTime+300; const templateRo0 = RecognitionObject.templateMatch(templateMat0); const templateRo1 = RecognitionObject.templateMatch(templateMat1); const templateRo2 = RecognitionObject.templateMatch(templateMat2); - templateRo0.threshold = 0.9; + templateRo0.threshold = threshold0; templateRo0.Use3Channels = true; - templateRo1.threshold = 0.9; + templateRo1.threshold = threshold0; templateRo1.Use3Channels = true; - templateRo2.threshold = 0.9; + templateRo2.threshold = threshold0; templateRo2.Use3Channels = true; // 捕获游戏区域 const gameRegion = captureGameRegion(); @@ -110,6 +111,8 @@ throw new Error("人家才不是错误呢>_<"); //主要流程 + + await sleep(1000); await pathingScript.runFile("assets/前往蒙德灶台.json"); keyPress("F"); @@ -141,6 +144,8 @@ log.info(`第${sum+1}次烹饪`); await sleep(1000); click(975, 900);//确认 await sleep(500); +click(215, 1015);//重新排序 +await sleep(500); click(1700, 1020);//制作 await sleep(500); click(1700, 1020);//制作 diff --git a/repo/js/烹饪熟练度一键拉满/manifest.json b/repo/js/烹饪熟练度一键拉满/manifest.json index e64d3cb8..32ea0693 100644 --- a/repo/js/烹饪熟练度一键拉满/manifest.json +++ b/repo/js/烹饪熟练度一键拉满/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 1, "name": "烹饪熟练度一键拉满", - "version": "1.0", - "description": "每个电脑都会有一定的误差,如果总是差一点,请自行在js设置中加减合适的时间,此外感谢万民堂对本脚本的大力支持。下面是一段广告:亲朋聚宴哪家强?吃虎岩找万民堂!璃月厨王掌厨房,菜品质量有保障!服务热情更在行,欢声笑语聚满堂!", + "version": "1.1", + "description": "如果总是差一点,请自行在js设置中加减合适的时间,烹饪不可用的时候,请选择合适的置信度。此外感谢万民堂对本脚本的大力支持。下面是一段广告:亲朋聚宴哪家强?吃虎岩找万民堂!璃月厨王掌厨房,菜品质量有保障!服务热情更在行,欢声笑语聚满堂!", "authors": [ { "name": "柒叶子", diff --git a/repo/js/烹饪熟练度一键拉满/settings.json b/repo/js/烹饪熟练度一键拉满/settings.json index 98387421..be189e25 100644 --- a/repo/js/烹饪熟练度一键拉满/settings.json +++ b/repo/js/烹饪熟练度一键拉满/settings.json @@ -5,6 +5,16 @@ "name": "extraTime", "type": "input-text", "label": "额外的烹饪时间(ms)" - } + }, -] \ No newline at end of file + + { + "name": "threshold0", + "type": "select", + "label": "不能正常烹饪的时候,请选择合适的置信度", + "options": [ + "0.85", + "0.8" + ] + } +]