优化自动兑换码输出 (#2117)

* 优化自动兑换码输出

* 优化自动兑换码输出
This commit is contained in:
躁动的氨气
2025-10-10 22:15:12 +08:00
committed by GitHub
parent 554006276f
commit fd757ca404
2 changed files with 7 additions and 2 deletions

View File

@@ -56,6 +56,8 @@ let username = settings.username || "default";
const content = file.readTextSync("codes.txt");
const codes = content.split("\n");
let count = 0;
for (let i = 0; i < codes.length; i++) {
const line = codes[i].trim();
if (!line) continue;
@@ -76,7 +78,7 @@ let username = settings.username || "default";
// 跳过已兑换的
if (redeemedCodes.has(code)) {
log.info(`检测到${redeemedCodes.size}个兑换码已兑换过,跳过`);
count++;
continue;
}
@@ -149,6 +151,9 @@ let username = settings.username || "default";
await sleep(4000);
}
if (count > 0) {
log.info(`检测到${count}个兑换码已兑换过,跳过`);
}
} catch (error) {
log.error(`读取兑换码文件失败: ${error}`);
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "自动使用兑换码",
"version": "6.0.3",
"version": "6.0.4",
"bgi_version": "0.45.0",
"description": "仅支持国服",
"authors": [