js:联机狗粮团购1.5.11 (#2252)

* js:联机狗粮团购1.5.11

增加对于阅读和对话界面的处理

* js:锄地一条龙1.9.11

回调汐酱改路线时乱改的时间信息

* js:锄地一条龙1.9.12

添加校验字段
This commit is contained in:
mno
2025-10-26 22:38:18 +08:00
committed by GitHub
parent 5fe6debf10
commit 8a5f00c4ac
400 changed files with 446 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -5,7 +5,7 @@ let pickupDelay = 100;
let timeMove = 1000;
let timeMoveUp = Math.round(timeMove * 0.45);
let timeMoveDown = Math.round(timeMove * 0.55);
let rollingDelay = 25;
let rollingDelay = 50;
let state;
let gameRegion;
let TMthreshold = +settings.TMthreshold || 0.9;
@@ -1120,15 +1120,51 @@ async function runPath(fullPath, targetItemPath) {
const errorProcessTask = (async () => {
const revivalRo1 = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/revival1.png"));
const readingRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/readingUI.png"), 72, 22, 133 - 72, 79 - 22);
const dialogueRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/dialogueUI.png"), 187, 26, 233 - 130, 69);
let errorCheckCount = 9;
while (state.running) {
await sleep(100);
errorCheckCount++;
if (errorCheckCount > 50) {
errorCheckCount = 0;
//log.info("尝试识别并点击复苏按钮");
if (await findAndClick(revivalRo1, 2)) {
//log.info("识别到复苏按钮,点击复苏");
if (await findAndClick(revivalRo1, 1)) {
log.info("识别到复苏按钮,点击复苏");
errorCheckCount = 50;
}
if (await findRo(readingRo, 1)) {
log.info("识别到阅读界面esc脱离");
await genshin.returnMainUi();
errorCheckCount = 50;
}
if (await findRo(dialogueRo, 1)) {
log.info("识别到对话界面,点击进行对话");
click(960, 540);
errorCheckCount = 50;
}
async function findRo(target, maxAttempts = 20) {
for (let attempts = 0; attempts < maxAttempts; attempts++) {
const gameRegion = captureGameRegion();
try {
const result = gameRegion.find(target);
if (result.isExist()) {
await sleep(250);
log.info("找到图标");
return true;
}
} catch (err) {
} finally {
gameRegion.dispose();
}
if (attempts < maxAttempts - 1) { // 最后一次不再 sleep
await sleep(250);
}
}
return false;
}
}
}
@@ -1440,7 +1476,7 @@ async function processArtifacts() {
const gameRegion = captureGameRegion();
try {
const result = gameRegion.find(target);
if (result.isExist) {
if (result.isExist()) {
await sleep(250);
result.click();
return true; // 成功立刻返回

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "AAA狗粮联机团购",
"version": "1.5.10",
"version": "1.5.11",
"tags": [
"狗粮"
],