1.修复识别与龙蛋不符合2.添加通知3.增加时长for稳定性 (#2363)

* Add files via upload

* Update main.js
This commit is contained in:
古又
2025-11-16 19:01:06 +08:00
committed by GitHub
parent d22147a63f
commit edfd391558
5 changed files with 35 additions and 69 deletions

View File

@@ -31,6 +31,11 @@
## 更新
### 版本:2.0.3
1.修复闪闪礼蛋识别与蛋名称不相符合
2.添加通知
3.增加时长,为了延长功能稳定性
### 版本:2.0.2
1.修改龙蛋滑动小段,直接跳出问题

View File

@@ -301,7 +301,7 @@ async function recordForFile(judge) {
record = {
lastRunDate: "1970/01/01",
lastActivateTime: new Date("1970-01-01T20:00:00.000Z"),
lastDragonEggsNum: "【山之血0太阳的轰鸣0圣龙君临0菲耶蒂娜0献给小酒杯0飞澜鲨鲨0】",
lastDragonEggsNum: "【山之血0飞澜鲨鲨0圣龙君临0太阳的轰鸣0献给小酒杯0菲耶蒂娜0】",
records: new Array(51).fill(""),
version: ""
};
@@ -427,7 +427,7 @@ async function chcekDragonEggs() {
{ min: DragonEgg.coordinates[0]-46, max: DragonEgg.coordinates[0]+34 }, { min: DragonEgg.coordinates[1]+56, max: DragonEgg.coordinates[1]+83 }, true);
// log.info(`第一次识别到的数字:${ocrEggNum.text}`);
if (ocrEggNum.text == "") {
await sleep(500);
await sleep(700);
ocrEggNum = await performOcr("",
{ min: DragonEgg.coordinates[0]-46, max: DragonEgg.coordinates[0]+34 }, { min: DragonEgg.coordinates[1]+56, max: DragonEgg.coordinates[1]+83 }, true);
// log.info(`第二次识别到的数字:${ocrEggNum.text}`);
@@ -447,7 +447,7 @@ async function chcekDragonEggs() {
{ min: DragonEgg.coordinates[0]-46, max: DragonEgg.coordinates[0]+34 }, { min: DragonEgg.coordinates[1]+56, max: DragonEgg.coordinates[1]+83 }, true);
// log.info(`第一次识别到的数字:${ocrEggNum.text}`);
if (ocrEggNum.text == "") {
await sleep(500);
await sleep(700);
ocrEggNum = await performOcr("",
{ min: DragonEgg.coordinates[0]-46, max: DragonEgg.coordinates[0]+34 }, { min: DragonEgg.coordinates[1]+56, max: DragonEgg.coordinates[1]+83 }, true);
// log.info(`第二次识别到的数字:${ocrEggNum.text}`);
@@ -494,14 +494,14 @@ async function chcekDragonEggs() {
};
};
log.info(`背包龙蛋数目: 【山之血:${DragonEggs[0]}太阳的轰鸣${DragonEggs[1]},圣龙君临:${DragonEggs[2]}菲耶蒂娜${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}飞澜鲨鲨${DragonEggs[5]}`);
log.info(`背包龙蛋数目: 【山之血:${DragonEggs[0]}飞澜鲨鲨${DragonEggs[1]},圣龙君临:${DragonEggs[2]}太阳的轰鸣${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}菲耶蒂娜${DragonEggs[5]}`);
if (settings.notify) {
notification.Send(`背包龙蛋数目: 【山之血:${DragonEggs[0]}太阳的轰鸣${DragonEggs[1]},圣龙君临:${DragonEggs[2]}菲耶蒂娜${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}飞澜鲨鲨${DragonEggs[5]}`);
notification.Send(`背包龙蛋数目: 【山之血:${DragonEggs[0]}飞澜鲨鲨${DragonEggs[1]},圣龙君临:${DragonEggs[2]}太阳的轰鸣${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}菲耶蒂娜${DragonEggs[5]}`);
};
// 更新记录
record.lastDragonEggsNum = `【山之血:${DragonEggs[0]}太阳的轰鸣${DragonEggs[1]},圣龙君临:${DragonEggs[2]}菲耶蒂娜${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}飞澜鲨鲨${DragonEggs[5]}`;
record.lastDragonEggsNum = `【山之血:${DragonEggs[0]}飞澜鲨鲨${DragonEggs[1]},圣龙君临:${DragonEggs[2]}太阳的轰鸣${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}菲耶蒂娜${DragonEggs[5]}`;
await recordForFile(false);
return `【山之血:${DragonEggs[0]}太阳的轰鸣${DragonEggs[1]},圣龙君临:${DragonEggs[2]}菲耶蒂娜${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}飞澜鲨鲨${DragonEggs[5]}`;;
return `【山之血:${DragonEggs[0]}飞澜鲨鲨${DragonEggs[1]},圣龙君临:${DragonEggs[2]}太阳的轰鸣${DragonEggs[3]},献给小酒杯:${DragonEggs[4]}菲耶蒂娜${DragonEggs[5]}`;;
};
// 检查过期物品
@@ -546,16 +546,16 @@ async function checkExpire() {
//识别对话位置,并点击
let ocrResults = await performOcr("神奇的", dialogZone.x, dialogZone.y, false);
if (ocrResults.success) {
await sleep(500);
await sleep(700);
await performOcr("如何才", dialogZone.x, dialogZone.y, false);
await sleep(500);
await sleep(700);
let ocrOver = await performOcr("已",{ min: 1482, max: 1630 }, { min: 912, max: 957 }, false);
if (ocrOver.success) {
log.info("已售罄!!!");
} else {
let ocrMora = await performOcr("", { min: 1600, max: 1780 }, { min: 30, max: 60 }, true);
if (ocrMora == "") {
await sleep(500);
await sleep(700);
ocrMora = await performOcr("", { min: 1600, max: 1780 }, { min: 30, max: 60 }, true);
};
if (BigInt(ocrMora.text) >= 300) {
@@ -810,7 +810,7 @@ async function checkExpire() {
await sleep(1000);
let ocrResults = await performOcr("布兰", dialogZone.x, dialogZone.y, false);
if (ocrResults.success) {
// await sleep(500);
await sleep(700);
let ocrResults1 = await performOcr("没什么", dialogZone.x, dialogZone.y, false);
if(ocrResults1.success){
log.info("对话出现没什么,默认领取和使用过!!!");
@@ -855,7 +855,7 @@ async function checkExpire() {
//识别获得的食物名称
let ocrText = await performOcr("", { min: 813, max: 985 }, { min: 585, max: 619 }, true);
if (ocrText.text == "") {
await sleep(500);
await sleep(700);
ocrText = await performOcr("", { min: 813, max: 985 }, { min: 585, max: 619 }, true);
};
log.info(`获得:${ocrText.text}`);
@@ -874,7 +874,7 @@ async function checkExpire() {
await sleep(3000);
let ocrText1 = await performOcr("", { min: 716, max: 1200 }, { min: 631, max: 710 }, true);
if (ocrText.text == "") {
await sleep(500);
await sleep(700);
ocrText1 = await performOcr("", { min: 716, max: 1200 }, { min: 631, max: 710 }, true);
};
let text = ocrText1.text.replace(/\r\n|\n|\r/g, "");
@@ -1039,7 +1039,7 @@ async function checkExpire() {
await sleep(6000);
let ocrText = await performOcr("", { min: 555, max: 1365 }, { min: 902, max: 1000 }, true);
if (ocrText.text == "") {
await sleep(500);
await sleep(700);
ocrText = await performOcr("", { min: 555, max: 1365 }, { min: 902, max: 1000 }, true);
};
log.info(`转盘运势:${ocrText.text}`);
@@ -1212,3 +1212,4 @@ async function checkExpire() {
})();

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "提瓦特杂事(收集)",
"version": "2.0.2",
"version": "2.0.3",
"tags": [
"玄学",
"收集",

View File

@@ -1,54 +1,9 @@
上次运行日期: 2025/10/29
上次上香时间: 2025-10-20T09:34:33.877Z
背包龙蛋数目: 【山之血1太阳的轰鸣2圣龙君临1菲耶蒂娜1献给小酒杯0飞澜鲨鲨0】
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
>>>>>>>>>> 2025年10月20日
幸运签内容: 「生活不是游戏。」
获得的食物: 美味的薄荷果冻
>>>>>>>>>> 2025年10月20日
转盘的运势: 『『层云蔽月,大地沉睡。』就是现在不是好时机,条件还没有凌齐的意思。」
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月19日
>>>>>>>>>> 2025年10月18日
>>>>>>>>>> 2025年10月18日
转盘的运势: 「『晨露凝珠,浆果丰盛。』就是今天会有收获的意思!」
>>>>>>>>>> 2025年10月18日
幸运签内容: 「别寻找什么捷径了,说不定去捷径的路现在都已站满了人。」
获得的食物: 香烤肋排
>>>>>>>>>> 2025年10月18日
抽签的结果: 大吉
>>>>>>>>>> 2025年10月18日
幸运签内容: 「再来一份!(开玩笑的)」
获得的食物: 塔塞斯杂烩
获得的食物: undefined
>>>>>>>>>> 2025年10月11日
转盘的运势: 「『旭日瞳瞳,驱散迷雾。』就是遇到困难也没关系,一定会得到帮助的意思!」
幸运签内容: 「当你觉得现状够糟时要保持警惕,因为事态往往还能变得更糟。」
获得的食物: 美味的咖啡芭芭露
抽签的结果: 吉
>>>>>>>>>> sa
抽签的结果: 中吉
转盘的运势: 「『海蛇翻腾,风暴肆虐。』就是不管做什么都会遇到阻碍的意思。」
幸运签内容: 「一时的好运只能带来片刻的满足,终身的幸福还得靠勤奋上进。」
获得的食物: 奇怪的肉酱千层面
抽签的结果: 大凶
抽签的结果: 撒不变
幸运签内容: 按时毕业
>>>>>>>2025年09月29
>>>>>>>2025年09月29日
转盘的运势:「『层云蔽月,大地沉睡。』
就是现在不是好时机,条件还没有凌齐的意思。」
获得的龙蛋:闪闪礼蛋·献给小酒杯
>>2025年09月27
获得的食物:
幸运签内容:

View File

@@ -109,6 +109,11 @@
],
"default": ""
},
{
"name": "notify",
"type": "checkbox",
"label": "\n---------------------通知---------------------\n是否开启通知"
},
{
"name": "accountName",
"type": "input-text",