diff --git a/alas.py b/alas.py index 23b5fc51d..bb7eae1ab 100644 --- a/alas.py +++ b/alas.py @@ -539,6 +539,10 @@ class AzurLaneAutoScript: from module.daemon.os_daemon import AzurLaneDaemon AzurLaneDaemon(config=self.config, device=self.device, task="OpsiDaemon").run() + def event_story(self): + from module.eventstory.eventstory import EventStory + EventStory(config=self.config, device=self.device, task="EventStory").run() + def azur_lane_uncensored(self): from module.daemon.uncensored import AzurLaneUncensored AzurLaneUncensored(config=self.config, device=self.device, task="AzurLaneUncensored").run() diff --git a/config/template.json b/config/template.json index ad6f8cce5..4b98de7ae 100644 --- a/config/template.json +++ b/config/template.json @@ -2099,6 +2099,14 @@ "Storage": {} } }, + "EventStory": { + "EventStory": { + "SkipBattle": true + }, + "Storage": { + "Storage": {} + } + }, "Benchmark": { "Benchmark": { "DeviceType": "emulator", diff --git a/module/campaign/gems_farming.py b/module/campaign/gems_farming.py index d67e11e7e..064196056 100644 --- a/module/campaign/gems_farming.py +++ b/module/campaign/gems_farming.py @@ -37,7 +37,7 @@ class GemsCampaignOverride(CampaignBase): return result if self.handle_popup_cancel('IGNORE_LOW_EMOTION'): - self.config.GEMS_EMOTION_TRIGGRED = True + self.config.GEMS_EMOTION_TRIGGERED = True logger.hr('EMOTION WITHDRAW') while 1: @@ -273,18 +273,12 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock): max_level = 70 scanner = ShipScanner(level=(max_level, max_level), emotion=(10, 150), - fleet=self.fleet_to_attack, status='free') + fleet=[0, self.fleet_to_attack], status='free') scanner.disable('rarity') - ships = scanner.scan(self.device.image) - if ships: - # Don't need to change current - return ships - - scanner.set_limitation(fleet=0) if self.config.GemsFarming_CommonDD in ['any', 'favourite', 'z20_or_z21']: # Change to any ship - return scanner.scan(self.device.image, output=False) + return scanner.scan(self.device.image) candidates = self.find_candidates(self.get_templates(self.config.GemsFarming_CommonDD), scanner) if candidates: @@ -388,7 +382,7 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock): logger.hr('TRIGGERED LV32 LIMIT') return True - if self.campaign.map_is_auto_search and self.campaign.config.GEMS_EMOTION_TRIGGRED: + if self.campaign.map_is_auto_search and self.campaign.config.GEMS_EMOTION_TRIGGERED: self._trigger_emotion = True logger.hr('TRIGGERED EMOTION LIMIT') return True @@ -434,7 +428,7 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock): self._trigger_lv32 = False self._trigger_emotion = False self.campaign.config.LV32_TRIGGERED = False - self.campaign.config.GEMS_EMOTION_TRIGGRED = False + self.campaign.config.GEMS_EMOTION_TRIGGERED = False # Scheduler if self.config.task_switched(): diff --git a/module/config/argument/args.json b/module/config/argument/args.json index b3cc9018a..235cc636a 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -10251,6 +10251,28 @@ } } }, + "EventStory": { + "EventStory": { + "SkipBattle": { + "type": "lock", + "value": true, + "option": [ + true + ], + "option_bold": [ + true + ] + } + }, + "Storage": { + "Storage": { + "type": "storage", + "value": {}, + "valuetype": "ignore", + "display": "disabled" + } + } + }, "Benchmark": { "Benchmark": { "DeviceType": { diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index b123e3144..a236340e8 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -812,6 +812,11 @@ Daemon: OpsiDaemon: RepairShip: true SelectEnemy: true +EventStory: + SkipBattle: + type: checkbox + value: false + option: [ true, false ] Benchmark: DeviceType: value: emulator diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index 46b1f27ac..33541bfe5 100644 --- a/module/config/argument/menu.json +++ b/module/config/argument/menu.json @@ -104,6 +104,7 @@ "tasks": [ "Daemon", "OpsiDaemon", + "EventStory", "Benchmark", "AzurLaneUncensored", "GameManager" diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index c002c710d..dcbe5d693 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -442,3 +442,13 @@ OpsiHazard1Leveling: ServerUpdate: 00:00, 12:00 OpsiFleet: Submarine: false + +# ==================== Tool ==================== + +EventStory: + EventStory: + SkipBattle: + type: lock + value: true + option: [ true, ] + option_bold: [ true, ] diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index 4a6bdaf47..b8f349f11 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -347,6 +347,8 @@ Tool: - Daemon OpsiDaemon: - OpsiDaemon + EventStory: + - EventStory Benchmark: - Benchmark AzurLaneUncensored: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 85b22b9ba..96287215a 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -518,6 +518,9 @@ class GeneratedConfig: OpsiDaemon_RepairShip = True OpsiDaemon_SelectEnemy = True + # Group `EventStory` + EventStory_SkipBattle = False # True, False + # Group `Benchmark` Benchmark_DeviceType = 'emulator' # emulator, plone_cloud_with_adb, phone_cloud_without_adb, android_phone, android_phone_vmos Benchmark_TestScene = 'screenshot_click' # screenshot_click, screenshot, click diff --git a/module/config/config_manual.py b/module/config/config_manual.py index 8707dcd76..818e4b12b 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -97,7 +97,7 @@ class ManualConfig: """ module.campaign.gems_farming """ - GEMS_EMOTION_TRIGGRED = False + GEMS_EMOTION_TRIGGERED = False """ module.handler diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index f93a965ab..f29c2988d 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -270,6 +270,10 @@ "name": "OpSi Semi-auto", "help": "" }, + "EventStory": { + "name": "Event Story", + "help": "" + }, "Benchmark": { "name": "Performance Test", "help": "" @@ -2819,6 +2823,18 @@ "help": "Clean nearby enemies and resources, and find new enemies or materials after cleaning, which usually clears the entire map. If some of them haven't been cleared, you need to solve them manually" } }, + "EventStory": { + "_info": { + "name": "Event Story", + "help": "Complete the event story, only applicable to events aired on or after 20241219, please wait for about 3 minutes" + }, + "SkipBattle": { + "name": "Kill game to skip battles", + "help": "", + "True": "Enabled", + "False": "False" + } + }, "Benchmark": { "_info": { "name": "Performance Test", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 65a171f37..73e15e170 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -270,6 +270,10 @@ "name": "セイレーン作戦半自動", "help": "" }, + "EventStory": { + "name": "Event Story", + "help": "" + }, "Benchmark": { "name": "機能テスト", "help": "" @@ -2819,6 +2823,18 @@ "help": "OpsiDaemon.SelectEnemy.help" } }, + "EventStory": { + "_info": { + "name": "EventStory._info.name", + "help": "EventStory._info.help" + }, + "SkipBattle": { + "name": "EventStory.SkipBattle.name", + "help": "EventStory.SkipBattle.help", + "True": "True", + "False": "False" + } + }, "Benchmark": { "_info": { "name": "Benchmark._info.name", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 348afb007..aa5fd70e1 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -270,6 +270,10 @@ "name": "大世界半自动", "help": "" }, + "EventStory": { + "name": "活动剧情", + "help": "" + }, "Benchmark": { "name": "性能测试", "help": "" @@ -2819,6 +2823,18 @@ "help": "清理附近的敌人和物资,清理完后又会找到新的敌人或物资,这样通常能清理整个海域,如果有遗漏或者点击错误,需要手动解决" } }, + "EventStory": { + "_info": { + "name": "活动剧情", + "help": "完成活动剧情,仅适用于上线时间20241219及之后的活动,请等待约3分钟" + }, + "SkipBattle": { + "name": "杀游戏跳过战斗", + "help": "", + "True": "已启用", + "False": "False" + } + }, "Benchmark": { "_info": { "name": "性能测试", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 84aa9d4b1..57638eaa2 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -270,6 +270,10 @@ "name": "大世界半自動", "help": "" }, + "EventStory": { + "name": "活動劇情", + "help": "" + }, "Benchmark": { "name": "性能測試", "help": "" @@ -2819,6 +2823,18 @@ "help": "清理附近的敵人和物資,清理完後又會找到新的敵人或物資,這樣通常能清理整個海域,如果有遺漏或者點擊錯誤,需要手動解決" } }, + "EventStory": { + "_info": { + "name": "活動劇情", + "help": "完成活動劇情,僅適用於上線時間20241219及以後的活動,請等待約3分鐘" + }, + "SkipBattle": { + "name": "關遊戲跳過戰鬥", + "help": "", + "True": "已启用", + "False": "False" + } + }, "Benchmark": { "_info": { "name": "性能測試", diff --git a/module/retire/scanner.py b/module/retire/scanner.py index c68d1d3c9..3217e60a4 100644 --- a/module/retire/scanner.py +++ b/module/retire/scanner.py @@ -64,6 +64,10 @@ class Ship: elif isinstance(value, tuple): if not (value[0] <= self.__dict__[key] <= value[1]): return False + # list means should be in the list + elif isinstance(value, list): + if self.__dict__[key] not in value: + return False return True @@ -384,6 +388,8 @@ class ShipScanner(Scanner): lower = self.sub_scanners[key].limit_value(lower) upper = self.sub_scanners[key].limit_value(upper) self.limitaion[key] = (lower, upper) + elif isinstance(value, list): + self.limitaion[key] = [self.sub_scanners[key].limit_value(v) for v in value] else: self.limitaion[key] = self.sub_scanners[key].limit_value(value) diff --git a/module/submodule/utils.py b/module/submodule/utils.py index 800dabe5d..5fdda4c93 100644 --- a/module/submodule/utils.py +++ b/module/submodule/utils.py @@ -17,6 +17,7 @@ def get_available_func(): return ( 'Daemon', 'OpsiDaemon', + 'EventStory', 'AzurLaneUncensored', 'Benchmark', 'GameManager',