fix: 识图改造补充体力,彻底修复因坐标点击导致误使用原石的问题
This commit is contained in:
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/ConfirmButton.png
Normal file
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/ConfirmButton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/FragileResin.png
Normal file
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/FragileResin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/PlusButton.png
Normal file
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/PlusButton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1005 B |
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/QuickUsePlusButton.png
Normal file
BIN
repo/js/首领讨伐一条龙/assets/RecognitionObject/QuickUsePlusButton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,3 +1,12 @@
|
|||||||
|
const PlusButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/PlusButton.png"), 1000, 0, 300, 100);
|
||||||
|
const FragileResinRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/FragileResin.png"), 800, 400, 200, 200);
|
||||||
|
const ConfirmButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/ConfirmButton.png"), 900, 700, 200, 200);
|
||||||
|
const QuickUsePlusButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/QuickUsePlusButton.png"), 1200, 600, 200, 100);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
let challengeNum = settings.challengeNum ?? 1;//挑战次数
|
let challengeNum = settings.challengeNum ?? 1;//挑战次数
|
||||||
let challengeName = settings.challengeName ?? 0;//挑战首领名称
|
let challengeName = settings.challengeName ?? 0;//挑战首领名称
|
||||||
@@ -85,25 +94,37 @@
|
|||||||
if (challengeName) {
|
if (challengeName) {
|
||||||
//使用树脂
|
//使用树脂
|
||||||
if (resinNum) {
|
if (resinNum) {
|
||||||
await genshin.returnMainUi();
|
try {
|
||||||
keyPress("M");//打开地图
|
await genshin.returnMainUi();
|
||||||
await sleep(1200);
|
keyPress("M");//打开地图
|
||||||
click(2476 / 2, 96 / 2);// 点击添加体力
|
await sleep(1200);
|
||||||
await sleep(600);
|
captureGameRegion().find(PlusButtonRo).click();// 点击添加体力
|
||||||
click(1660 / 2, 950 / 2)// 选择脆弱树脂
|
|
||||||
await sleep(600);
|
|
||||||
click(2350 / 2, 1550 / 2);// 点击使用
|
|
||||||
await sleep(600);
|
|
||||||
for (let i = 1; i < resinNum; ++i) {
|
|
||||||
click(2586 / 2, 1296 / 2);// 点击使用数量
|
|
||||||
await sleep(600);
|
await sleep(600);
|
||||||
|
captureGameRegion().find(FragileResinRo).click();// 选择脆弱树脂
|
||||||
|
await sleep(600);
|
||||||
|
captureGameRegion().find(ConfirmButtonRo).click();// 点击使用
|
||||||
|
await sleep(600);
|
||||||
|
|
||||||
|
let QuickUsePlusButton = captureGameRegion().find(QuickUsePlusButtonRo);
|
||||||
|
if (isNaN(settings.resinNum) || settings.resinNum <= 0) {
|
||||||
|
number = 1
|
||||||
|
} else {
|
||||||
|
for (let i = 1; i < settings.resinNum; ++i) {
|
||||||
|
QuickUsePlusButton.click();// 点击使用数量
|
||||||
|
await sleep(300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
captureGameRegion().find(ConfirmButtonRo).click();// 点击使用
|
||||||
|
await sleep(600);
|
||||||
|
click(960, 1000);// 点击空白处
|
||||||
|
await genshin.returnMainUi();
|
||||||
|
} catch {
|
||||||
|
log.warn(`没有脆弱树脂了!!!`)
|
||||||
|
} finally {
|
||||||
|
await genshin.returnMainUi();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
click(2350 / 2, 1550 / 2);// 点击使用
|
|
||||||
await sleep(600);
|
|
||||||
click(1920 / 2, 1500 / 2);// 点击空白处
|
|
||||||
await sleep(600);
|
|
||||||
keyPress("VK_ESCAPE");//关闭地图
|
|
||||||
}
|
}
|
||||||
if (samePlace == "YES") log.info(`已启用原地连续挑战模式`);
|
if (samePlace == "YES") log.info(`已启用原地连续挑战模式`);
|
||||||
log.info(`前往第1次恢复状态`);
|
log.info(`前往第1次恢复状态`);
|
||||||
|
|||||||
Reference in New Issue
Block a user