diff --git a/repo/js/计算机/manifest.json b/repo/js/计算机/manifest.json index 1cee5b93..2bcfd3c9 100644 --- a/repo/js/计算机/manifest.json +++ b/repo/js/计算机/manifest.json @@ -3,6 +3,7 @@ "name": "计算机自动睡眠、关机等操作", "version": "1.0", "description": "计算机的自动关机、注销、休眠等操作(默认注销)", + "tags": ["计算机", "关机", "注销", "休眠", "重启"], "authors": [ { "name": "呱呱z", diff --git a/repo/js/铁匠铺/assets/Picture/AmethystLump.png b/repo/js/铁匠铺/assets/Picture/AmethystLump.png index d6ce99c9..7689681c 100644 Binary files a/repo/js/铁匠铺/assets/Picture/AmethystLump.png and b/repo/js/铁匠铺/assets/Picture/AmethystLump.png differ diff --git a/repo/js/铁匠铺/assets/Picture/CondessenceCrystal.png b/repo/js/铁匠铺/assets/Picture/CondessenceCrystal.png index 82030321..e1925366 100644 Binary files a/repo/js/铁匠铺/assets/Picture/CondessenceCrystal.png and b/repo/js/铁匠铺/assets/Picture/CondessenceCrystal.png differ diff --git a/repo/js/铁匠铺/assets/Picture/CrystalChunk.png b/repo/js/铁匠铺/assets/Picture/CrystalChunk.png index 4b7f8cde..a6b6068b 100644 Binary files a/repo/js/铁匠铺/assets/Picture/CrystalChunk.png and b/repo/js/铁匠铺/assets/Picture/CrystalChunk.png differ diff --git a/repo/js/铁匠铺/assets/Picture/IronChunk.png b/repo/js/铁匠铺/assets/Picture/IronChunk.png index ee80acd8..b1f7b16f 100644 Binary files a/repo/js/铁匠铺/assets/Picture/IronChunk.png and b/repo/js/铁匠铺/assets/Picture/IronChunk.png differ diff --git a/repo/js/铁匠铺/assets/Picture/Starsilver.png b/repo/js/铁匠铺/assets/Picture/Starsilver.png index 9213a9b8..f5edd9a3 100644 Binary files a/repo/js/铁匠铺/assets/Picture/Starsilver.png and b/repo/js/铁匠铺/assets/Picture/Starsilver.png differ diff --git a/repo/js/铁匠铺/assets/Picture/WhiteIronChunk.png b/repo/js/铁匠铺/assets/Picture/WhiteIronChunk.png index 74ae3296..c05992d5 100644 Binary files a/repo/js/铁匠铺/assets/Picture/WhiteIronChunk.png and b/repo/js/铁匠铺/assets/Picture/WhiteIronChunk.png differ diff --git a/repo/js/铁匠铺/main.js b/repo/js/铁匠铺/main.js index 301a9894..108a6c46 100644 --- a/repo/js/铁匠铺/main.js +++ b/repo/js/铁匠铺/main.js @@ -53,24 +53,17 @@ function recognizeImage(imagePath, x, y, searchWidth, searchHeight) { try { let template = file.ReadImageMatSync(imagePath); - let recognitionObject = RecognitionObject.TemplateMatch( - template, - x, - y, - searchWidth, - searchHeight - ); + let recognitionObject = RecognitionObject.TemplateMatch(template, x, y, searchWidth, searchHeight); // 设置识别阈值和通道 - recognitionObject.threshold = 0.9; // 设置识别阈值 + /* prettier-ignore */ + recognitionObject.threshold = 0.85; // 设置识别阈值 recognitionObject.Use3Channels = true; // 使用三通道匹配 let result = captureGameRegion().find(recognitionObject); return result.isExist() ? result : null; } catch (error) { - log.error( - `图像识别失败,路径: ${imagePath}, 错误: ${error.message}` - ); + log.error(`图像识别失败,路径: ${imagePath}, 错误: ${error.message}`); return null; } } @@ -102,31 +95,27 @@ // 锻造矿石操作 const forgeOre = async function (smithyName) { - await sleep(1000); - keyPress("F"); - await sleep(1000); // 开始交互 - await click(960, 600); - await sleep(1000); // 跳过第一个对话 - await click(960, 600); - await sleep(1000); // 跳过第一个对话 - await click(1375, 500); - await sleep(1000); - await click(960, 600); - await sleep(1000); // 跳过第二个对话 - await click(960, 600); - await sleep(1000); // 跳过第二个对话 + // 对话 + /* prettier-ignore */ + { + await sleep(1000);keyPress("F"); // 开始交互 + await sleep(1000);await click(960, 600); // + await sleep(1000);await click(960, 600); // 跳过第一个对话 + await sleep(1000);await click(1375, 500); // 跳过第一个对话 + await sleep(1000);await click(960, 600);await sleep(1000); // 跳过第二个对话 + await click(960, 600);await sleep(1000); // 跳过第二个对话 + } log.info("已进入锻造界面,准备锻造"); // 锻造领取 - await click(520, 140); - await sleep(1000); // 选择锻造队列 - await click(170, 1010); - await sleep(1000); // 领取全部 - await click(960, 900); - await sleep(1000); // 确认 + /* prettier-ignore */ + { + await click(520, 140);await sleep(1000); // 选择锻造队列 + await click(170, 1010);await sleep(1000); // 领取全部 + await click(960, 900);await sleep(1000); // 确认 + click(220, 150);await sleep(1000); // 点击"配方" + } - click(220, 150); - await sleep(1000); // 点击"配方" determineOre(); // 根据用户选择的矿石进行锻造 @@ -141,27 +130,18 @@ for (const coordinate of gridCoordinates) { const scanX = coordinate.x + scanOffset.x; const scanY = coordinate.y + scanOffset.y; + const imageResult = recognizeImage(imagePath, scanX, scanY, 70, 70); - const imageResult = recognizeImage( - imagePath, - scanX, - scanY, - 70, - 70 - ); if (imageResult) { log.info(`通过图像识别找到矿石: ${chineseDescription}`); imageResult.click(); await sleep(2000); // 等待点击生效 foundIngredient = true; + /* prettier-ignore */ // 点击“开始锻造”3次 - click(1645, 1015); - await sleep(1500); - click(1645, 1015); - await sleep(1500); - click(1645, 1015); - await sleep(1500); + { await sleep(1000); click(1645, 1015); await sleep(1000); click(1645, 1015); await sleep(1000); } + break; // 找到矿石后退出循环 } } @@ -174,12 +154,11 @@ log.info("锻造结束,退出界面"); keyPress("ESCAPE"); }; - await autoSmithy(smithyName); //寻路函数 - await forgeOre(smithyName); + await autoSmithy(smithyName); // 寻路函数 + await forgeOre(smithyName); // 锻造函数 await genshin.returnMainUi(); // 返回主界面 - keyDown("S"); - await sleep(1000); - keyUp("S"); - await sleep(1000); + + /* prettier-ignore */ + {keyDown("S");await sleep(1000);keyUp("S");await sleep(1000); } // 后退两步 })(); diff --git a/repo/js/铁匠铺/manifest.json b/repo/js/铁匠铺/manifest.json index 94fafcb3..10e918eb 100644 --- a/repo/js/铁匠铺/manifest.json +++ b/repo/js/铁匠铺/manifest.json @@ -1,8 +1,10 @@ { "manifest_version": 1, "name": "自动锻造魔矿(识图)", - "version": "1.2(2025.05.12版)", - "description": "自动选择铁匠铺和使用矿物去锻造魔矿。\n使用前请阅读“readme”文件\n鸣谢:寒露,蜜柑魚", + "version": "1.3(2025.05.15版)", + "bgi_version": "0.44.0", + "description": "自动选择铁匠铺和使用矿物去锻造精锻矿。\n使用前请阅读“readme”文件。\n鸣谢:寒露,蜜柑魚", + "tags": ["铁匠铺", "锻造", "精锻用矿"], "authors": [ { "name": "呱呱z" diff --git a/repo/js/铁匠铺/readme(25.05.12).md b/repo/js/铁匠铺/readme(25.05.15).md similarity index 91% rename from repo/js/铁匠铺/readme(25.05.12).md rename to repo/js/铁匠铺/readme(25.05.15).md index 14960b3a..5b3062b3 100644 --- a/repo/js/铁匠铺/readme(25.05.12).md +++ b/repo/js/铁匠铺/readme(25.05.15).md @@ -50,8 +50,12 @@ ## 更新日志 -### 1.2 +### 1.2(2025.05.15) +- 修复选择“萃凝晶”时无法识别的问题 +- 仓库内新增标签。 + +### 1.2(2025.05.12) - 修复选择“萃凝晶”时无法识别的 bug -### 1.1 +### 1.1(2025.05.01) - 优化矿石选取方式,改用识图模式