mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-05-20 22:25:50 +08:00
AEscoffier_chef、AutoFishingTeyvat_bait【更新】 (#3037)
* update 1. 优化了材料余量读取,确保被作为培养素材的材料数量也能正常读取 * update 1. 优化了材料余量读取,确保被作为培养素材的材料数量也能正常读取
This commit is contained in:
@@ -648,6 +648,10 @@
|
||||
- 更新日志
|
||||
<details>
|
||||
<summary> 点击展开 </summary>
|
||||
|
||||
- ver 2.3.7
|
||||
|
||||
1. 优化了材料余量读取,确保被作为培养素材的材料数量也能正常读取
|
||||
|
||||
- ver 2.3.6
|
||||
|
||||
|
||||
@@ -301,6 +301,20 @@
|
||||
return item_num;
|
||||
}
|
||||
}
|
||||
} else if (ocr_area[i].text.includes("培养需求")) {
|
||||
refer_y = ocr_area[i].y;
|
||||
|
||||
for (let j = 0; j < ocr_area.length; j++) {
|
||||
let string = ocr_area[j].text.replace(/\D/g, '');
|
||||
if (string && ocr_area[j].y > refer_y - 12 && ocr_area[j].y < refer_y + 12) { // 纯数字且y坐标范围合理
|
||||
string = string.split("/")[0].replace(/\D/g, '');
|
||||
item_num = parseInt(string, 10);
|
||||
log.debug(`识别到物品数量: ${item_num}`);
|
||||
click(x, y); // 点击空白处返回
|
||||
await sleep(500);
|
||||
return item_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item_num !== -1) break;
|
||||
}
|
||||
@@ -875,7 +889,7 @@
|
||||
click(material_site[i]["x"], material_site[i]["y1"]);
|
||||
await sleep(500);
|
||||
let ocrResult = await Ocr(881, 763, 158, 267);
|
||||
if (ocrResult && ocrResult.text.includes("当前拥有")) {
|
||||
if (ocrResult && (ocrResult.text.includes("当前拥有") || ocrResult.text.includes("培养需求"))) {
|
||||
flag = true;
|
||||
} else {
|
||||
// 点击食材(下)
|
||||
@@ -884,7 +898,7 @@
|
||||
click(material_site[i]["x"], material_site[i]["y2"]);
|
||||
await sleep(500);
|
||||
let ocrResult = await Ocr(881, 763, 158, 267);
|
||||
if (ocrResult && ocrResult.text.includes("当前拥有")) {
|
||||
if (ocrResult && (ocrResult.text.includes("当前拥有") || ocrResult.text.includes("培养需求"))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "一只爱可菲",
|
||||
"version": "2.3.6",
|
||||
"version": "2.3.7",
|
||||
"bgi_version": "0.55.0",
|
||||
"description": "专精料理制作的爱可菲(自动烹饪及解锁、特殊料理、食材加工)[内置料理数据已更新至月之四]\n自动烹饪:烹饪精度自定义、一键全解锁、分类选择料理、自动处理食材不足等异常\n特殊料理:支持根据概率计算产出、支持全部的特殊料理\n食材加工:食材持有量检测、可自选制作鱼肉的配方、可选等待加工完成或跳过、矿石加速",
|
||||
"tags": [
|
||||
|
||||
@@ -499,6 +499,19 @@
|
||||
await sleep(500);
|
||||
}
|
||||
}
|
||||
} else if (ocr_area[i].text.includes("培养需求")) {
|
||||
refer_y = ocr_area[i].y;
|
||||
|
||||
for (let j = 0; j < ocr_area.length; j++) {
|
||||
let string = ocr_area[j].text.replace(/\D/g, '');
|
||||
if (string && ocr_area[j].y > refer_y - 12 && ocr_area[j].y < refer_y + 12) { // 纯数字且y坐标范围合理
|
||||
string = string.split("/")[0].replace(/\D/g, '');
|
||||
material_num[k === 0 ? 0: 1] = parseInt(string, 10);
|
||||
log.info(`识别到 ${name} 的原料${k === 0 ? 1: 2}(${bait_msg[name][k === 0 ? 0: 1]})数量: ${material_num[k === 0 ? 0: 1]}`);
|
||||
click(1480, 974); // 点击空白处返回
|
||||
await sleep(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (material_num[k === 0 ? 0: 1] !== -1) break;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "提瓦特自动饵料机[测试版]",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"bgi_version": "0.55.0",
|
||||
"description": "全自动合成鱼饵(支持自动获取原料)",
|
||||
"authors": [
|
||||
|
||||
Reference in New Issue
Block a user