diff --git a/repo/js/AutoRefinedCondensationResin/README.md b/repo/js/AutoRefinedCondensationResin/README.md index ecbd21dd6..a95a7d43b 100644 --- a/repo/js/AutoRefinedCondensationResin/README.md +++ b/repo/js/AutoRefinedCondensationResin/README.md @@ -15,6 +15,18 @@ ## 参数说明 | 参数名 | 类型 | 说明 | |------------|------------|----------------------------------------------------------------------| -| location | 下拉选择 | **合成台位置**
可选:蒙德/璃月/稻妻/枫丹
默认:璃月合成台 | -| everyDay | 复选框 | **每日执行开关**
开启后无视星期设置,每日自动执行 | -| week | 文本输入 | **指定执行星期**
格式:逗号分隔数字(1=周一,7=周日)
例:`2,3,4,5,6,7` | \ No newline at end of file +| **合成台位置** | 下拉选择 | 可选:蒙德/璃月/稻妻/枫丹
默认:璃月合成台 | +| **每日执行开关** | 复选框 | 开启后无视星期设置,每日自动执行 | +| **指定执行星期** | 文本输入 | 格式:逗号分隔数字(1=周一,7=周日)
例:`2,3,4,5,6,7` | + + +### 更新日志 +### 1.3 +1. 更改默认合成台為蒙德合成台 +### 1.2 +1. 合成树脂前先解除筛选状态 +### 1.1 +1. 修正指定执行星期只输入1个数字时执行错误 +### 1.0 + +1. 初始版本发布 diff --git a/repo/js/AutoRefinedCondensationResin/assets/RecognitionObject/Clear.png b/repo/js/AutoRefinedCondensationResin/assets/RecognitionObject/Clear.png new file mode 100644 index 000000000..bcd175bb3 Binary files /dev/null and b/repo/js/AutoRefinedCondensationResin/assets/RecognitionObject/Clear.png differ diff --git a/repo/js/AutoRefinedCondensationResin/main.js b/repo/js/AutoRefinedCondensationResin/main.js index 0f0f4c900..d86babce9 100644 --- a/repo/js/AutoRefinedCondensationResin/main.js +++ b/repo/js/AutoRefinedCondensationResin/main.js @@ -1,8 +1,9 @@ // 识图资料 const confirmRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/confirm.png")); const CondensedResin = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/Condensed_Resin.png")); +const Clear = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/Clear.png")); // 读取配置文件 -const location = settings.location; +let location = settings.location; const settingsWeek = settings.week; const everyDay = settings.everyDay; @@ -34,6 +35,7 @@ async function condensedResin() { captureRegion.dispose(); for (let i = 0; i < resList.count; i++) { if (resList[i].text.includes("合成")) { + // 找到合成台,点击合成台 log.info("寻找合成台成功,开始与合成台交互"); keyDown("VK_MENU");// Alt @@ -45,6 +47,16 @@ async function condensedResin() { keyUp("VK_MENU");// Alt await sleep(1000); + const ro0 = captureGameRegion(); + let Resin0 = ro0.find(Clear); + ro0.dispose(); + if (Resin0.isExist()) { + log.info("筛选中,先取消筛选"); + await sleep(750); + Resin0.click(); + await sleep(750); + } + // 图像识别浓缩树脂 const ro1 = captureGameRegion(); let Resin = ro1.find(CondensedResin); @@ -58,7 +70,7 @@ async function condensedResin() { ro2.dispose(); if (confirm.isExist()) { confirm.click(); // 点击合成 - await sleep(5000); + await sleep(3000); click(975, 900); // 点击确认,关闭合成成功资料 log.info("已完成合成浓缩树脂"); } @@ -98,24 +110,21 @@ async function condensedResin() { } (async function () { + // 获取 function validateAndStoreNumbers(input) { - // 定义存储结果的数组 - let storedNumbers = []; - + // 去除所有空格 + const cleanedInput = input.replace(/\s/g, ''); + // 使用正则表达式检测是否符合期望格式 - const regex = /^(\b([1-9]|1[0-5])\b)(,(\b([1-9]|1[0-5])\b))*$/; - + const regex = /^([1-7])(,([1-7]))*$/; + // 检测输入字符串是否符合正则表达式 - if (regex.test(input)) { + if (regex.test(cleanedInput)) { // 将输入字符串按逗号分割成数组 - const numbers = input.split(','); - - // 将分割后的数字字符串转换为整数并存储到数组中 - storedNumbers = numbers.map(Number); - - return storedNumbers; + const numbers = cleanedInput.split(','); + return numbers.map(Number); } else { - return false + return false; } } @@ -137,9 +146,6 @@ async function condensedResin() { return dayOfWeek === 0 ? 7 : dayOfWeek; } - - - //main/====================================================================================== setGameMetrics(1920, 1080, 1) await genshin.returnMainUi(); @@ -152,7 +158,7 @@ async function condensedResin() { log.info("已开启每天都合成体力,无视星期设置"); try { if (!location) { - location = "璃月合成台"; + location = "蒙德合成台"; log.info(`未设置传送位置,默认前往 ${location}...`); } log.info(`正在前往 ${location} 合成浓缩树脂`); diff --git a/repo/js/AutoRefinedCondensationResin/manifest.json b/repo/js/AutoRefinedCondensationResin/manifest.json index a2b145149..0b97447d2 100644 --- a/repo/js/AutoRefinedCondensationResin/manifest.json +++ b/repo/js/AutoRefinedCondensationResin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "自动合成浓缩树脂", - "version": "1.1", + "version": "1.3", "bgi_version": "0.47.0", "description": "\n可前往多国合成台自动合成浓缩树脂(仅支持中文语言)。\n通过OCR技术确保准确进入合成台并完成合成操作。\n可设置特定星期执行任务(例:输入\"1,3,5,7\"在周一/三/五/日执行)。\n特殊时间处理:00:00~04:00视为前一天。", "tags": [ diff --git a/repo/js/AutoRefinedCondensationResin/settings.json b/repo/js/AutoRefinedCondensationResin/settings.json index d4af67c43..7a0a403d5 100644 --- a/repo/js/AutoRefinedCondensationResin/settings.json +++ b/repo/js/AutoRefinedCondensationResin/settings.json @@ -2,7 +2,7 @@ { "name": "location", "type": "select", - "label": "合成台位置(默认:璃月合成台)", + "label": "合成台位置(默认:蒙德合成台)", "options": [ "蒙德合成台", "璃月合成台", @@ -11,7 +11,7 @@ //"纳塔合成台", "枫丹合成台" ], - "default": "璃月合成台" + "default": "蒙德合成台" }, { "name": "everyDay",