熟练度一键拉满JS脚本更新:解决了在烹饪过程中,熟练度未满,食材不够导致的退出问题 (#571)

* Update manifest.json

* Update main.js

* Update settings.json

* Update settings.json

* Update main.js
This commit is contained in:
5117600049
2025-04-14 10:22:33 +08:00
committed by GitHub
parent 6c20f2e9aa
commit 7e800a31d7
3 changed files with 24 additions and 9 deletions

View File

@@ -3,10 +3,11 @@
//OCR得到烹制时间 //模板匹配得到烹制时间
async function getPerfectCookingWaitTime() { async function getPerfectCookingWaitTime() {
let extraTime = settings.extraTime || 0; // 如果转换失败,默认 0 let extraTime = settings.extraTime || 0; //
let threshold0 = Number(settings.threshold0) || 0.9;
extraTime = extraTime+300; extraTime = extraTime+300;
const checkPoints = [ const checkPoints = [
{x: 741, y: 772}, // 原始点1 {x: 741, y: 772}, // 原始点1
@@ -54,11 +55,11 @@ extraTime = extraTime+300;
const templateRo0 = RecognitionObject.templateMatch(templateMat0); const templateRo0 = RecognitionObject.templateMatch(templateMat0);
const templateRo1 = RecognitionObject.templateMatch(templateMat1); const templateRo1 = RecognitionObject.templateMatch(templateMat1);
const templateRo2 = RecognitionObject.templateMatch(templateMat2); const templateRo2 = RecognitionObject.templateMatch(templateMat2);
templateRo0.threshold = 0.9; templateRo0.threshold = threshold0;
templateRo0.Use3Channels = true; templateRo0.Use3Channels = true;
templateRo1.threshold = 0.9; templateRo1.threshold = threshold0;
templateRo1.Use3Channels = true; templateRo1.Use3Channels = true;
templateRo2.threshold = 0.9; templateRo2.threshold = threshold0;
templateRo2.Use3Channels = true; templateRo2.Use3Channels = true;
// 捕获游戏区域 // 捕获游戏区域
const gameRegion = captureGameRegion(); const gameRegion = captureGameRegion();
@@ -110,6 +111,8 @@ throw new Error("人家才不是错误呢>_<");
//主要流程 //主要流程
await sleep(1000); await sleep(1000);
await pathingScript.runFile("assets/前往蒙德灶台.json"); await pathingScript.runFile("assets/前往蒙德灶台.json");
keyPress("F"); keyPress("F");
@@ -141,6 +144,8 @@ log.info(`第${sum+1}次烹饪`);
await sleep(1000); await sleep(1000);
click(975, 900);//确认 click(975, 900);//确认
await sleep(500); await sleep(500);
click(215, 1015);//重新排序
await sleep(500);
click(1700, 1020);//制作 click(1700, 1020);//制作
await sleep(500); await sleep(500);
click(1700, 1020);//制作 click(1700, 1020);//制作

View File

@@ -1,8 +1,8 @@
{ {
"manifest_version": 1, "manifest_version": 1,
"name": "烹饪熟练度一键拉满", "name": "烹饪熟练度一键拉满",
"version": "1.0", "version": "1.1",
"description": "每个电脑都会有一定的误差,如果总是差一点请自行在js设置中加减合适的时间此外感谢万民堂对本脚本的大力支持。下面是一段广告亲朋聚宴哪家强吃虎岩找万民堂璃月厨王掌厨房菜品质量有保障服务热情更在行欢声笑语聚满堂", "description": "如果总是差一点请自行在js设置中加减合适的时间烹饪不可用的时候,请选择合适的置信度。此外感谢万民堂对本脚本的大力支持。下面是一段广告:亲朋聚宴哪家强?吃虎岩找万民堂!璃月厨王掌厨房,菜品质量有保障!服务热情更在行,欢声笑语聚满堂!",
"authors": [ "authors": [
{ {
"name": "柒叶子", "name": "柒叶子",

View File

@@ -5,6 +5,16 @@
"name": "extraTime", "name": "extraTime",
"type": "input-text", "type": "input-text",
"label": "额外的烹饪时间(ms)" "label": "额外的烹饪时间(ms)"
} },
]
{
"name": "threshold0",
"type": "select",
"label": "不能正常烹饪的时候,请选择合适的置信度",
"options": [
"0.85",
"0.8"
]
}
]