diff --git a/repo/js/烹饪熟练度一键拉满/assets/best0.png b/repo/js/烹饪熟练度一键拉满/assets/best0.png new file mode 100644 index 00000000..f1b71037 Binary files /dev/null and b/repo/js/烹饪熟练度一键拉满/assets/best0.png differ diff --git a/repo/js/烹饪熟练度一键拉满/assets/best1.png b/repo/js/烹饪熟练度一键拉满/assets/best1.png new file mode 100644 index 00000000..e412ebde Binary files /dev/null and b/repo/js/烹饪熟练度一键拉满/assets/best1.png differ diff --git a/repo/js/烹饪熟练度一键拉满/assets/best2.png b/repo/js/烹饪熟练度一键拉满/assets/best2.png new file mode 100644 index 00000000..9e0283e0 Binary files /dev/null and b/repo/js/烹饪熟练度一键拉满/assets/best2.png differ diff --git a/repo/js/烹饪熟练度一键拉满/assets/前往蒙德灶台.json b/repo/js/烹饪熟练度一键拉满/assets/前往蒙德灶台.json new file mode 100644 index 00000000..e47e54b3 --- /dev/null +++ b/repo/js/烹饪熟练度一键拉满/assets/前往蒙德灶台.json @@ -0,0 +1,30 @@ +{ + "info": { + "name": "未命名路径", + "type": "collect", + "author": "柒叶子", + "version": "1.0", + "description": "前往蒙德灶台", + "bgiVersion": "0.42.3" + }, + "positions": [ + { + "id": 1, + "action": "", + "move_mode": "walk", + "type": "teleport", + "x": -867.6640625, + "y": 2281.363525390625, + "action_params": "" + }, + { + "id": 2, + "x": -883.5908203125, + "y": 2243.572509765625, + "type": "target", + "move_mode": "walk", + "action": "", + "action_params": "" + } + ] +} \ No newline at end of file diff --git a/repo/js/烹饪熟练度一键拉满/main.js b/repo/js/烹饪熟练度一键拉满/main.js new file mode 100644 index 00000000..21793421 --- /dev/null +++ b/repo/js/烹饪熟练度一键拉满/main.js @@ -0,0 +1,158 @@ + +(async function () { + + + +//OCR得到烹制时间 +async function getPerfectCookingWaitTime() { + +let extraTime = settings.extraTime || 0; // 如果转换失败,默认 0 +extraTime = extraTime+300; + const checkPoints = [ + {x: 741, y: 772}, // 原始点1 + {x: 758, y: 766}, // 中间点1-2 + {x: 776, y: 760}, // 原始点2 + {x: 793, y: 755}, // 中间点2-3 + {x: 810, y: 751}, // 原始点3 + {x: 827, y: 747}, // 中间点3-4 + {x: 845, y: 744}, // 原始点4 + {x: 861, y: 742}, // 中间点4-5 + {x: 878, y: 740}, // 原始点5 + {x: 897, y: 737}, // 中间点5-6 + {x: 916, y: 735}, // 原始点6 + {x: 933, y: 735}, // 中间点6-7 + {x: 950, y: 736}, // 原始点7 + {x: 968, y: 736}, // 中间点7-8 + {x: 986, y: 737}, // 原始点8 + {x: 1002, y: 738}, // 中间点8-9 + {x: 1019, y: 740}, // 原始点9 + {x: 1038, y: 742}, // 中间点9-10 + {x: 1057, y: 744}, // 原始点10 + {x: 1074, y: 748}, // 中间点10-11 + {x: 1092, y: 752}, // 原始点11 + {x: 1107, y: 757}, // 中间点11-12 + {x: 1122, y: 762}, // 原始点12 + {x: 1138, y: 766}, // 中间点12-13 + {x: 1154, y: 770}, // 原始点13 + {x: 1170, y: 774}, // 中间点13-14 + {x: 1193, y: 779} // 原始点14 + + + + ]; + + // 区域大小 + const regionSize = 60; + + // 加载模板图片 + const templateMat0 = file.readImageMatSync("assets/best0.png"); + const templateMat1 = file.readImageMatSync("assets/best1.png"); + const templateMat2 = file.readImageMatSync("assets/best2.png"); + + + // 创建模板匹配识别对象 + const templateRo0 = RecognitionObject.templateMatch(templateMat0); + const templateRo1 = RecognitionObject.templateMatch(templateMat1); + const templateRo2 = RecognitionObject.templateMatch(templateMat2); + templateRo0.threshold = 0.9; + templateRo0.Use3Channels = true; + templateRo1.threshold = 0.9; + templateRo1.Use3Channels = true; + templateRo2.threshold = 0.9; + templateRo2.Use3Channels = true; + // 捕获游戏区域 + const gameRegion = captureGameRegion(); + + // 检查每个点 + for (let i = 0; i < checkPoints.length; i++) { + const point = checkPoints[i]; + + // 裁剪出当前检测区域 + const region = gameRegion.deriveCrop( + point.x - regionSize/2, + point.y - regionSize/2, + regionSize, + regionSize + ); + +let result; + if (i < 9) { + result = region.find(templateRo0); + } else if (i >= 18) { + result = region.find(templateRo2); + } else { + result = region.find(templateRo1); + } + + if (!result.isEmpty()) { + + const segmentTime = 66; + + + const waitTime = Math.round(i * segmentTime+extraTime); + log.info(`找到点位${i}号区域`); + await sleep(waitTime); + keyPress("VK_SPACE"); + return 0; + } + + } + + log.info(`未找到点位区域,烹饪结束`); +keyPress("ESCAPE"); +await sleep(1000); +keyPress("ESCAPE"); +throw new Error("人家才不是错误呢>_<"); +} + + + + + +//主要流程 +await sleep(1000); +await pathingScript.runFile("assets/前往蒙德灶台.json"); +keyPress("F"); +await sleep(1000); +click(910, 51);//选择料理 +await sleep(1000); +click(170, 1020);//筛选 +await sleep(500); +click(195, 1020);//重置 +await sleep(500); +click(195, 675);//熟练度未满 +await sleep(1000); +click(490, 1020);//确认筛选 +await sleep(1000); + +let sum= 0; + + while (1) { +await sleep(500); +click(175, 200);//选择第一个菜 +await sleep(500); +click(1700, 1020);//制作 +await sleep(1000); +click(1080, 1015);//手动烹饪 +await sleep(1000);//等待画面稳定 +//自动烹饪 +await getPerfectCookingWaitTime(); +log.info(`第${sum+1}次烹饪`); +await sleep(1000); +click(975, 900);//确认 +await sleep(500); +click(1700, 1020);//制作 +await sleep(500); +click(1700, 1020);//制作 +await sleep(1000); +keyPress("ESCAPE"); +await sleep(1000); +click(215, 1015);//重新排序 +await sleep(1000); +sum++; + } + + + + +})(); diff --git a/repo/js/烹饪熟练度一键拉满/manifest.json b/repo/js/烹饪熟练度一键拉满/manifest.json new file mode 100644 index 00000000..e64d3cb8 --- /dev/null +++ b/repo/js/烹饪熟练度一键拉满/manifest.json @@ -0,0 +1,14 @@ +{ + "manifest_version": 1, + "name": "烹饪熟练度一键拉满", + "version": "1.0", + "description": "每个电脑都会有一定的误差,如果总是差一点,请自行在js设置中加减合适的时间,此外感谢万民堂对本脚本的大力支持。下面是一段广告:亲朋聚宴哪家强?吃虎岩找万民堂!璃月厨王掌厨房,菜品质量有保障!服务热情更在行,欢声笑语聚满堂!", + "authors": [ + { + "name": "柒叶子", + "link": "https://github.com/511760049" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} diff --git a/repo/js/烹饪熟练度一键拉满/settings.json b/repo/js/烹饪熟练度一键拉满/settings.json new file mode 100644 index 00000000..98387421 --- /dev/null +++ b/repo/js/烹饪熟练度一键拉满/settings.json @@ -0,0 +1,10 @@ +[ + + + { + "name": "extraTime", + "type": "input-text", + "label": "额外的烹饪时间(ms)" + } + +] \ No newline at end of file