Compare commits
4 Commits
71823d7b84
...
447a72b303
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
447a72b303 | ||
|
|
68ffddf868 | ||
|
|
9724dfecf8 | ||
|
|
16e191fd05 |
370
repo.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"time": "20250812232941",
|
"time": "20250813085452",
|
||||||
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
||||||
"file": "repo.json",
|
"file": "repo.json",
|
||||||
"indexes": [
|
"indexes": [
|
||||||
@@ -43518,9 +43518,9 @@
|
|||||||
"lastUpdated": "2025-08-12 15:51:02"
|
"lastUpdated": "2025-08-12 15:51:02"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "A21-枫丹-厄里那斯内部北区.json",
|
"name": "A21-萃凝晶-枫丹-厄里那斯内部北区.json",
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"hash": "cf84af3db9f4750199f7dad70e20ab7203c144e0",
|
"hash": "47e8f68522b987c7c58a2ad7812e90551a7b5048",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"author": "芝士贝果",
|
"author": "芝士贝果",
|
||||||
"authors": [
|
"authors": [
|
||||||
@@ -43536,7 +43536,357 @@
|
|||||||
"挖矿",
|
"挖矿",
|
||||||
"战斗"
|
"战斗"
|
||||||
],
|
],
|
||||||
"lastUpdated": "2025-08-11 19:40:30"
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A22-萃凝晶-枫丹-厄里那斯.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "70fba75a96e1d9dc910879ea3150e302ddd0cf7f",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A23-萃凝晶-枫丹-卡布狄斯堡的遗迹下方.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "d6573af42ec43d38943660cab35d74d930b37cf9",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A24-萃凝晶-枫丹-枫丹廷左上角传送锚点下方.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "e0da0315943fc0e4b7c542c161c16ca3c12be5e2",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A25-萃凝晶-枫丹-伊犁耶林区七天神像上方.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "83d3e7ff06b180cb4fdc84f4238cf3be2b6c4905",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A26-萃凝晶-枫丹-优兰尼娅湖左上方.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "7a9b689cd2f1e848cd3a8365f06d150197835382",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"有攀爬"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A27-萃凝晶-枫丹-优兰尼娅湖右岸.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "a46b0adbad4cab25e673178fb78311b0b5068e62",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A28-萃凝晶-枫丹-湖中垂柳岸边.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "4ae77c8bdfe8d0714b5ce9b0bc3b4996fcc4a0f7",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A29-萃凝晶-枫丹-湖中垂柳传送点旁.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "01094e7e6f52069b90c153a72c585ad60ac94fdd",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A30-萃凝晶-枫丹-水与土之眼上部传送点上方.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "3a66900bb89fd3d626339d7e452a2c3f77d9bf87",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A31-萃凝晶-枫丹-伊犁耶林区右上角.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "fc0aa27ef5796947d8dff156990667fb48112eb1",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A32-萃凝晶-枫丹-黎翡区七天神像.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "84d213f3af08d246135847bfd7a4c8ce75dcd7a1",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A33-萃凝晶-枫丹-枫丹动能工程科学研究院区.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "7581d8a8b9244f97c34fb2e4c87ea45f76329d7a",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 20:29:10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A34-萃凝晶-枫丹-玛丽安纪念公园七天神像.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "b294e5429c673abca2ded1dc993dfbfd6498c171",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 23:02:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A35-萃凝晶-枫丹-枫丹动能工程科学研究院区.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "d098b639f51cb7f6ca5c51bfe43ccfeddd6a0415",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"战斗",
|
||||||
|
"有攀爬"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 23:02:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A36-萃凝晶-枫丹-新枫丹科学院.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "458b6679b24801d7ca7ec151bde53d6028878a53",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 23:02:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A37-萃凝晶-枫丹-枫丹动能工程科学研究院区左上角.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "ce712316200d71716316648dc2f8c2aab7f58cfa",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿",
|
||||||
|
"有攀爬"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 23:02:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A38-萃凝晶-枫丹-学术会堂左边.json",
|
||||||
|
"type": "file",
|
||||||
|
"hash": "f582fde7f194a86a606d7a838c2564dcc4cdae11",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "芝士贝果",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "芝士贝果"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.45.0",
|
||||||
|
"矿物",
|
||||||
|
"萃凝晶",
|
||||||
|
"挖矿"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-12 23:02:21"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "B01-萃凝晶-纳塔-万火之瓯01.json",
|
"name": "B01-萃凝晶-纳塔-万火之瓯01.json",
|
||||||
@@ -56021,7 +56371,7 @@
|
|||||||
{
|
{
|
||||||
"name": "01-澄晶实-隆崛坡地下-4个.json",
|
"name": "01-澄晶实-隆崛坡地下-4个.json",
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"hash": "7b1a67dac1d0cd17b9f5c02f4a973200ee3102af",
|
"hash": "f012c2ffec3fb36a238e60d4605f464bc136678f",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"author": "Tool_tingsu",
|
"author": "Tool_tingsu",
|
||||||
"authors": [
|
"authors": [
|
||||||
@@ -56037,7 +56387,7 @@
|
|||||||
"澄晶实",
|
"澄晶实",
|
||||||
"纳西妲"
|
"纳西妲"
|
||||||
],
|
],
|
||||||
"lastUpdated": "2025-08-10 14:42:24"
|
"lastUpdated": "2025-08-12 20:31:02"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "02-澄晶实-祖遗庙宇地下1-4个.json",
|
"name": "02-澄晶实-祖遗庙宇地下1-4个.json",
|
||||||
@@ -75607,13 +75957,17 @@
|
|||||||
{
|
{
|
||||||
"name": "Auto Theft NPC & 原食",
|
"name": "Auto Theft NPC & 原食",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
"hash": "ff233f392581ae04e2872ed26a5f1e833c7527a5",
|
"hash": "7c134fa7dc0334644a8681acc2e003eeee8d18a3",
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"author": "听雨♪",
|
"author": "听雨♪",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "听雨♪",
|
"name": "听雨♪",
|
||||||
"link": "https://github.com/TingYu-lulumi"
|
"link": "https://github.com/TingYu-lulumi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "蜜柑魚",
|
||||||
|
"link": "https://github.com/this-Fish"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "购买NPC食材-图像识别~|~原食脚本: 基于图像识别的购买NPC商品, 可选择性购买商品, 按地区顺序购买, 节省大量时间.",
|
"description": "购买NPC食材-图像识别~|~原食脚本: 基于图像识别的购买NPC商品, 可选择性购买商品, 按地区顺序购买, 节省大量时间.",
|
||||||
@@ -75621,7 +75975,7 @@
|
|||||||
"购买食材",
|
"购买食材",
|
||||||
"图像识别"
|
"图像识别"
|
||||||
],
|
],
|
||||||
"lastUpdated": "2025-08-11 12:55:32"
|
"lastUpdated": "2025-08-13 08:52:59"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "AutoArtifactsPro",
|
"name": "AutoArtifactsPro",
|
||||||
|
|||||||
@@ -413,12 +413,16 @@ async function spikChat(npcName) {
|
|||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
if(npcName== "布纳马"){
|
if(npcName== "布纳马"){
|
||||||
// 對話
|
// 對話
|
||||||
await sleep(500);
|
|
||||||
keyDown("VK_MENU");// Alt
|
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
await click(1255, 530);
|
// keyDown("VK_MENU");// Alt
|
||||||
await sleep(1000);
|
// await sleep(1500);
|
||||||
keyUp("VK_MENU");// Alt
|
// await click(1255, 530);
|
||||||
|
// await click(1255, 530);
|
||||||
|
// await click(1255, 530);
|
||||||
|
// await sleep(1500);
|
||||||
|
// keyUp("VK_MENU");// Alt
|
||||||
|
keyPress("VK_F");
|
||||||
|
await sleep(1500);
|
||||||
// 跳過交互&進入買食畫面
|
// 跳過交互&進入買食畫面
|
||||||
await click(1345, 580);
|
await click(1345, 580);
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
{
|
{
|
||||||
"name": "听雨♪",
|
"name": "听雨♪",
|
||||||
"links": "https://github.com/TingYu-lulumi"
|
"links": "https://github.com/TingYu-lulumi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "蜜柑魚",
|
||||||
|
"links": "https://github.com/this-Fish"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
兑换码支持用非字母数字串隔开,
|
|
||||||
例如输入“DUIHUANMA111 DUIHUANMA222%.&*()DUIHUANMA333#¥”,
|
|
||||||
可以识别出DUIHUANMA111,DUIHUANMA222,DUIHUANMA333三个兑换码,
|
|
||||||
不过还是建议用空格隔开例如“DUIHUANMA111 DUIHUANMA222 DUIHUANMA333”
|
|
||||||
|
|
||||||
不需要关闭该脚本。该脚本自动检测新旧兑换码,无需反复启停该脚本。脚本现在能正确检测兑换码(自定义配置)变化并只在新兑换码(自定义配置)出现时执行。
|
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
@@ -1,168 +0,0 @@
|
|||||||
(async function () {
|
|
||||||
// 定义状态文件路径
|
|
||||||
const STATE_FILE = "redeem_state.json";
|
|
||||||
|
|
||||||
// 1. 检查配置项是否存在
|
|
||||||
if (typeof settings === 'undefined' || typeof settings.redeemCodes === 'undefined') {
|
|
||||||
log.error("兑换码配置项不存在,脚本终止运行");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 获取当前兑换码配置
|
|
||||||
const currentCodesText = settings.redeemCodes || "";
|
|
||||||
const currentCodes = currentCodesText.split(/\s+/).filter(code => code.trim() !== "");
|
|
||||||
|
|
||||||
if (currentCodes.length === 0) {
|
|
||||||
log.info("未检测到兑换码,脚本终止运行");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 读取上次兑换状态(使用 try-catch 替代 existsSync)
|
|
||||||
let lastRunCodes = [];
|
|
||||||
try {
|
|
||||||
// 直接尝试读取文件,如果文件不存在会抛出异常
|
|
||||||
const stateData = file.readTextSync(STATE_FILE);
|
|
||||||
lastRunCodes = JSON.parse(stateData);
|
|
||||||
log.info(`读取到上次兑换码配置: ${lastRunCodes.join(" ")}`);
|
|
||||||
} catch (error) {
|
|
||||||
// 文件不存在是正常情况,不需要警告
|
|
||||||
if (!error.message.includes("文件不存在")) {
|
|
||||||
log.warning(`读取状态文件失败: ${error.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 检查兑换码是否变化
|
|
||||||
const hasChanged = !arraysEqual(currentCodes, lastRunCodes);
|
|
||||||
|
|
||||||
if (!hasChanged) {
|
|
||||||
log.info("兑换码配置未变化,脚本终止运行");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info(`检测到新兑换码配置: ${currentCodesText}`);
|
|
||||||
setGameMetrics(1920, 1080, 1);
|
|
||||||
// 5. 返回主界面,等待1秒
|
|
||||||
await genshin.returnMainUi();
|
|
||||||
await sleep(1000);
|
|
||||||
|
|
||||||
// 6. 通过keyPress点按esc键(VK_ESCAPE),等待2秒
|
|
||||||
keyPress("ESCAPE");
|
|
||||||
await sleep(2000);
|
|
||||||
|
|
||||||
const settingsRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/settings.png"));
|
|
||||||
const settingsRes = captureGameRegion().find(settingsRo);
|
|
||||||
if (settingsRes.isExist()) {
|
|
||||||
settingsRes.click();
|
|
||||||
}
|
|
||||||
await sleep(2000);
|
|
||||||
|
|
||||||
const accountRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/account.png"));
|
|
||||||
const accountRes = captureGameRegion().find(accountRo);
|
|
||||||
if (accountRes.isExist()) {
|
|
||||||
accountRes.click();
|
|
||||||
}
|
|
||||||
await sleep(500);
|
|
||||||
|
|
||||||
const goToRedeemRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/go_to_redeem.png"));
|
|
||||||
const goToRedeemRes = captureGameRegion().find(goToRedeemRo);
|
|
||||||
if (goToRedeemRes.isExist()) {
|
|
||||||
goToRedeemRes.click();
|
|
||||||
}
|
|
||||||
await sleep(500);
|
|
||||||
|
|
||||||
try {
|
|
||||||
for (const code of currentCodes) {
|
|
||||||
log.info(`处理兑换码: ${code}`);
|
|
||||||
|
|
||||||
// b. 识别输入兑换码图片并点击
|
|
||||||
const inputCodeRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/input_code.png"));
|
|
||||||
const inputCodeRes = captureGameRegion().find(inputCodeRo);
|
|
||||||
if (inputCodeRes.isExist()) {
|
|
||||||
inputCodeRes.click();
|
|
||||||
}
|
|
||||||
await sleep(300);
|
|
||||||
|
|
||||||
// c. 通过虚拟键代码依次keyPress键入兑换码的每一个字符
|
|
||||||
await inputText(code);
|
|
||||||
await sleep(500);
|
|
||||||
|
|
||||||
// d. 输入完毕后,识别兑换图片并点击,等待1.5秒
|
|
||||||
const redeemRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/redeem.png"));
|
|
||||||
const redeemRes = captureGameRegion().find(redeemRo);
|
|
||||||
if (redeemRes.isExist()) {
|
|
||||||
redeemRes.click();
|
|
||||||
}
|
|
||||||
await sleep(1500);
|
|
||||||
|
|
||||||
// e. 识别各种状态图片
|
|
||||||
const invalidRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/invalid.png"));
|
|
||||||
const invalidRes = captureGameRegion().find(invalidRo);
|
|
||||||
if (invalidRes.isExist()) {
|
|
||||||
log.info(`兑换码【${code}】无效`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const usedRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/used.png"));
|
|
||||||
const usedRes = captureGameRegion().find(usedRo);
|
|
||||||
if (usedRes.isExist()) {
|
|
||||||
log.info(`兑换码【${code}】已使用`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const expiredRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/expired.png"));
|
|
||||||
const expiredRes = captureGameRegion().find(expiredRo);
|
|
||||||
if (expiredRes.isExist()) {
|
|
||||||
log.info(`兑换码【${code}】已过期`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const notopenRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/not_open.png"));
|
|
||||||
const notopenRes = captureGameRegion().find(notopenRo);
|
|
||||||
if (notopenRes.isExist()) {
|
|
||||||
log.info(`兑换码【${code}】未开启`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/confirm.png"));
|
|
||||||
const confirmRes = captureGameRegion().find(confirmRo);
|
|
||||||
if (confirmRes.isExist()) {
|
|
||||||
log.info(`兑换码【${code}】成功兑换`);
|
|
||||||
confirmRes.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
// f. 识别清除图片并点击
|
|
||||||
const clearRo = RecognitionObject.TemplateMatch(file.readImageMatSync("assets/clear.png"));
|
|
||||||
const clearRes = captureGameRegion().find(clearRo);
|
|
||||||
if (clearRes.isExist()) {
|
|
||||||
clearRes.click();
|
|
||||||
}
|
|
||||||
await sleep(4000);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
log.error(`处理兑换码时出错: ${error}`);
|
|
||||||
return; // 出错时不更新状态
|
|
||||||
}
|
|
||||||
|
|
||||||
// 7. 所有兑换码兑换完成后返回主界面
|
|
||||||
await genshin.returnMainUi();
|
|
||||||
|
|
||||||
// 8. 保存当前兑换码到状态文件
|
|
||||||
try {
|
|
||||||
file.writeTextSync(STATE_FILE, JSON.stringify(currentCodes));
|
|
||||||
log.info("兑换码状态已更新");
|
|
||||||
} catch (error) {
|
|
||||||
log.error(`保存状态文件失败: ${error}`);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
// 辅助函数:比较两个数组是否相同
|
|
||||||
function arraysEqual(a, b) {
|
|
||||||
if (a === b) return true;
|
|
||||||
if (a == null || b == null) return false;
|
|
||||||
if (a.length !== b.length) return false;
|
|
||||||
|
|
||||||
// 创建副本避免修改原数组
|
|
||||||
const sortedA = [...a].sort();
|
|
||||||
const sortedB = [...b].sort();
|
|
||||||
|
|
||||||
for (let i = 0; i < sortedA.length; i++) {
|
|
||||||
if (sortedA[i] !== sortedB[i]) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"manifest_version": 1,
|
|
||||||
"name": "自动使用多个兑换码",
|
|
||||||
"version": "2.0",
|
|
||||||
"description": "自动使用兑换码,自定义配置里输入兑换码,多个兑换码支持用非字母数字串隔开,建议用空格隔开。自动检测新旧兑换码,无需反复启停该脚本",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "miludelongwang",
|
|
||||||
"links": "https://github.com/miludelongwang"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"settings_ui": "settings.json",
|
|
||||||
"main": "main.js"
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
["DUIHUANMA111","DUIHUANMA222","DUIHUANMA333"]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "redeemCodes",
|
|
||||||
"type": "input-text",
|
|
||||||
"label": "兑换码(多个兑换码支持用非字母数字串隔开,建议用空格隔开)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# 2.0
|
|
||||||
新增自动检测新旧兑换码,无需反复启停该脚本。脚本现在能正确检测兑换码(自定义配置)变化并只在新兑换码(自定义配置)出现时执行。
|
|
||||||
兑换码支持用非字母数字串隔开,例如输入“DUIHUANMA111 DUIHUANMA222%.&*()DUIHUANMA333#¥”,可以识别出DUIHUANMA111,DUIHUANMA222,DUIHUANMA333三个兑换码,不过还是建议用空格隔开例如“DUIHUANMA111 DUIHUANMA222 DUIHUANMA333”
|
|
||||||
# 1.0
|
|
||||||
自动使用兑换码,自定义配置里输入兑换码,多个兑换码间用空格隔开。
|
|
||||||