diff --git a/repo/js/DestroyArtifactsForMora/main.js b/repo/js/DestroyArtifactsForMora/main.js index bcbe885c..9887a500 100644 --- a/repo/js/DestroyArtifactsForMora/main.js +++ b/repo/js/DestroyArtifactsForMora/main.js @@ -3,12 +3,13 @@ const DeleteButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("As const AutoAddButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/AutoAddButton.png")); const ConfirmButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/ConfirmButton.png")); const DestoryButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/DestoryButton.png")); +const MidDestoryButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/DestoryButton.png"), 900, 600, 500, 300); /** * @returns {Promise} */ -(async function() { +(async function () { await genshin.returnMainUi(); keyPress("B"); await sleep(1500); @@ -21,15 +22,15 @@ const DestoryButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("A } //计算摧毁次数 - if (settings.number > 21){ - times = Math.ceil(settings.number/100) - } else if (settings.number <= 21){ + if (settings.number > 21) { + times = Math.ceil(settings.number / 100) + } else if (settings.number <= 21) { times = settings.number } else { times = 1 } try { - for (let i=0 ;i < times ; i++) { + for (let i = 0; i < times; i++) { captureGameRegion().find(DeleteButtonRo).click();// 点击摧毁 await sleep(600); captureGameRegion().find(AutoAddButtonRo).click();// 点击自动添加 @@ -37,31 +38,31 @@ const DestoryButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("A if (settings.oneStar) { await sleep(300); - click(150,150); + click(150, 150); } if (settings.twoStar) { await sleep(300); - click(150,220); + click(150, 220); } if (settings.threeStar) { await sleep(300); - click(150,300); + click(150, 300); } if (settings.fourStar) { await sleep(300); - click(150,370); + click(150, 370); } captureGameRegion().find(ConfirmButtonRo).click();// 点击快捷放入 await sleep(600); captureGameRegion().find(DestoryButtonRo).click();// 点击摧毁 await sleep(600); - captureGameRegion().find(DestoryButtonRo).click();// 弹出页面点击摧毁 + captureGameRegion().find(MidDestoryButtonRo).click();// 弹出页面点击摧毁 await sleep(600); click(960, 1000);// 点击空白处 await sleep(1000); } - } catch(ex) { + } catch (ex) { log.info("背包里的圣遗物已摧毁完毕,提前结束") } finally { await genshin.returnMainUi(); diff --git a/repo/js/DestroyArtifactsForMora/manifest.json b/repo/js/DestroyArtifactsForMora/manifest.json index 097f5b2d..33707619 100644 --- a/repo/js/DestroyArtifactsForMora/manifest.json +++ b/repo/js/DestroyArtifactsForMora/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "摧毁圣遗物换摩拉", - "version": "1.0", + "version": "1.1", "bgi_version": "0.44.6", "description": "图像识别改造版", "authors": [