diff --git a/repo/js/AutoFriendshipFight/main.js b/repo/js/AutoFriendshipFight/main.js index fbb4760bd..6c8255acc 100644 --- a/repo/js/AutoFriendshipFight/main.js +++ b/repo/js/AutoFriendshipFight/main.js @@ -8,10 +8,10 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120; (async function () { const startTime = Date.now(); // 启用自动拾取的实时任务 - if (settings.pickupMode == "自动拾取") { + if (convertToTrueIfNotBoolean(settings.pickupMode)) { dispatcher.addTimer(new RealtimeTimer("AutoPick")); log.info("已 启用 自动拾取任务"); - } else if (settings.pickupMode == "不拾取") { + } else { log.info("已 禁用 自动拾取任务"); } runTimes = await calulateRunTimes(); @@ -52,7 +52,9 @@ const DEFAULT_FIGHT_TIMEOUT_SECONDS = 120; log.info(`${enemyType}好感运行总时长:${LogTimeTaken(startTime)}`); })(); - +function convertToTrueIfNotBoolean(value) { + return typeof value === 'boolean' ? value : true; +} // 执行 path 任务 async function AutoPath(locationName) { try { diff --git a/repo/js/AutoFriendshipFight/manifest.json b/repo/js/AutoFriendshipFight/manifest.json index 819f3bd33..0851469bc 100644 --- a/repo/js/AutoFriendshipFight/manifest.json +++ b/repo/js/AutoFriendshipFight/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "战斗好感:自动好感度&卡时间", - "version": "1.4.2", + "version": "1.4.3", "bgi_version": "0.45.1", "tags": [ "好感", diff --git a/repo/js/AutoFriendshipFight/settings.json b/repo/js/AutoFriendshipFight/settings.json index 83803ea65..2c00d9f5b 100644 --- a/repo/js/AutoFriendshipFight/settings.json +++ b/repo/js/AutoFriendshipFight/settings.json @@ -1,13 +1,9 @@ [ { "name": "pickupMode", - "type": "select", - "label": "拾取模式", - "options": [ - "自动拾取", - "不拾取" - ], - "default": "自动拾取" + "type": "checkbox", + "label": "是否启用自动拾取实时任务", + "default": true }, { "name": "enemyType",