Просмотр исходного кода

fix(ActivityShikigami): Normalize configuration translations

neptine 2 месяцев назад
Родитель
Сommit
d26d33e010

+ 65 - 1
assets/i18n/zh-CN.json

@@ -70,5 +70,69 @@
   "long_rest_duration_help": "触发累计活跃上限后的强制休息时长。格式:天 时:分:秒。",
   "long_rest_duration_help": "触发累计活跃上限后的强制休息时长。格式:天 时:分:秒。",
   "min_run_interval": "最小再运行间隔",
   "min_run_interval": "最小再运行间隔",
   "min_run_interval_help": "防风控:两次蹭卡运行之间的最小间隔,避免蹭卡过于频繁被服务端标记。设为 0(默认)保持原逻辑(按结界卡剩余时间安排下次)。格式:天 时:分:秒。",
   "min_run_interval_help": "防风控:两次蹭卡运行之间的最小间隔,避免蹭卡过于频繁被服务端标记。设为 0(默认)保持原逻辑(按结界卡剩余时间安排下次)。格式:天 时:分:秒。",
-  "costume_shikigami_11": "花札幕台"
+  "costume_shikigami_11": "花札幕台",
+  "enable_switch_pass": "切换门票爬塔御魂",
+  "enable_switch_pass_help": "是否切换门票爬塔御魂",
+  "pass_group_team": "门票爬塔御魂分组",
+  "pass_group_team_help": "组1-7,队伍1-4 中间用英文,分隔",
+  "enable_switch_pass_by_name": "通过OCR切换门票爬塔御魂",
+  "enable_switch_pass_by_name_help": "是否通过OCR切换御魂",
+  "pass_group_team_name": "门票爬塔御魂分组名、队伍名",
+  "pass_group_team_name_help": "组名,队伍名 中间用英文,分隔",
+  "enable_switch_ap": "切换体力爬塔御魂",
+  "enable_switch_ap_help": "是否切换体力爬塔御魂",
+  "ap_group_team": "体力爬塔御魂分组",
+  "ap_group_team_help": "组1-7,队伍1-4 中间用英文,分隔",
+  "enable_switch_ap_by_name": "通过OCR切换体力爬塔御魂",
+  "enable_switch_ap_by_name_help": "是否通过OCR切换御魂",
+  "ap_group_team_name": "体力爬塔御魂分组名、队伍名",
+  "ap_group_team_name_help": "组名,队伍名 中间用英文,分隔",
+  "enable_switch_boss": "切换Boss爬塔御魂",
+  "enable_switch_boss_help": "是否切换boss爬塔御魂",
+  "boss_group_team": "Boss爬塔御魂分组",
+  "boss_group_team_help": "组1-7,队伍1-4 中间用英文,分隔",
+  "enable_switch_boss_by_name": "通过OCR切换Boss爬塔御魂",
+  "enable_switch_boss_by_name_help": "是否通过OCR切换御魂",
+  "boss_group_team_name": "Boss爬塔御魂分组名、队伍名",
+  "boss_group_team_name_help": "组名,队伍名 中间用英文,分隔",
+  "enable_switch_ap100": "切换100体爬塔御魂",
+  "enable_switch_ap100_help": "是否切换100体爬塔御魂",
+  "ap100_group_team": "100体爬塔御魂分组",
+  "ap100_group_team_help": "组1-7,队伍1-4 中间用英文,分隔",
+  "enable_switch_ap100_by_name": "通过OCR切换100体爬塔御魂",
+  "enable_switch_ap100_by_name_help": "是否通过OCR切换御魂",
+  "ap100_group_team_name": "100体爬塔御魂分组名、队伍名",
+  "ap100_group_team_name_help": "组名,队伍名 中间用英文,分隔",
+  "enable_pass_preset": "切换门票爬塔预设",
+  "enable_pass_preset_help": "是否切换门票爬塔预设, 仅数字切换御魂可用",
+  "enable_pass_green": "开启门票爬塔绿标",
+  "enable_pass_green_help": "是否开启门票爬塔绿标",
+  "pass_green_mark": "门票爬塔绿标位置",
+  "pass_green_mark_help": "门票爬塔绿标位置",
+  "enable_pass_anti_detect": "门票爬塔防检测",
+  "enable_pass_anti_detect_help": "门票爬塔战斗过程是否随机点击或滑动",
+  "enable_ap_preset": "切换体力爬塔预设",
+  "enable_ap_preset_help": "是否切换体力爬塔预设, 仅数字切换御魂可用",
+  "enable_ap_green": "开启体力爬塔绿标",
+  "enable_ap_green_help": "是否开启体力爬塔绿标",
+  "ap_green_mark": "体力爬塔绿标位置",
+  "ap_green_mark_help": "体力爬塔绿标位置",
+  "enable_ap_anti_detect": "体力爬塔防检测",
+  "enable_ap_anti_detect_help": "体力爬塔战斗过程是否随机点击或滑动",
+  "enable_boss_preset": "切换Boss爬塔预设",
+  "enable_boss_preset_help": "是否切换boss爬塔预设, 仅数字切换御魂可用",
+  "enable_boss_green": "开启Boss爬塔绿标",
+  "enable_boss_green_help": "是否开启boss爬塔绿标",
+  "boss_green_mark": "Boss爬塔绿标位置",
+  "boss_green_mark_help": "boss爬塔绿标位置",
+  "enable_boss_anti_detect": "Boss爬塔防检测",
+  "enable_boss_anti_detect_help": "boss爬塔战斗过程是否随机点击或滑动",
+  "enable_ap100_preset": "切换100体爬塔预设",
+  "enable_ap100_preset_help": "是否切换100体爬塔预设, 仅数字切换御魂可用",
+  "enable_ap100_green": "开启100体爬塔绿标",
+  "enable_ap100_green_help": "是否开启100体爬塔绿标",
+  "ap100_green_mark": "100体爬塔绿标位置",
+  "ap100_green_mark_help": "100体爬塔绿标位置",
+  "enable_ap100_anti_detect": "100体爬塔防检测",
+  "enable_ap100_anti_detect_help": "100体爬塔战斗过程是否随机点击或滑动"
 }
 }

+ 38 - 38
tasks/ActivityShikigami/config.py

@@ -36,25 +36,25 @@ def check_soul_by_ocr(enable_switch: bool, group_team: str, label: str):
 
 
 
 
 class SwitchSoulConfig(BaseModel):
 class SwitchSoulConfig(BaseModel):
-    enable_switch_pass: bool = Field(default=False, description='是否切换门票爬塔御魂')
-    pass_group_team: str = Field(default='-1,-1', description='组1-7,队伍1-4 中间用英文,分隔')
-    enable_switch_pass_by_name: bool = Field(default=False, description='是否通过ocr切换御魂')
-    pass_group_team_name: str = Field(default='', description='组名,队伍名 中间用英文,分隔')
-
-    enable_switch_ap: bool = Field(default=False, description='是否切换体力爬塔御魂')
-    ap_group_team: str = Field(default='-1,-1', description='组1-7,队伍1-4 中间用英文,分隔')
-    enable_switch_ap_by_name: bool = Field(default=False, description='是否通过ocr切换御魂')
-    ap_group_team_name: str = Field(default='', description='组名,队伍名 中间用英文,分隔')
-
-    enable_switch_boss: bool = Field(default=False, description='是否切换boss爬塔御魂')
-    boss_group_team: str = Field(default='-1,-1', description='组1-7,队伍1-4 中间用英文,分隔')
-    enable_switch_boss_by_name: bool = Field(default=False, description='是否通过ocr切换御魂')
-    boss_group_team_name: str = Field(default='', description='组名,队伍名 中间用英文,分隔')
-
-    enable_switch_ap100: bool = Field(default=False, description='是否切换100体爬塔御魂')
-    ap100_group_team: str = Field(default='-1,-1', description='组1-7,队伍1-4 中间用英文,分隔')
-    enable_switch_ap100_by_name: bool = Field(default=False, description='是否通过ocr切换御魂')
-    ap100_group_team_name: str = Field(default='', description='组名,队伍名 中间用英文,分隔')
+    enable_switch_pass: bool = Field(default=False, description='enable_switch_pass_help')
+    pass_group_team: str = Field(default='-1,-1', description='pass_group_team_help')
+    enable_switch_pass_by_name: bool = Field(default=False, description='enable_switch_pass_by_name_help')
+    pass_group_team_name: str = Field(default='', description='pass_group_team_name_help')
+
+    enable_switch_ap: bool = Field(default=False, description='enable_switch_ap_help')
+    ap_group_team: str = Field(default='-1,-1', description='ap_group_team_help')
+    enable_switch_ap_by_name: bool = Field(default=False, description='enable_switch_ap_by_name_help')
+    ap_group_team_name: str = Field(default='', description='ap_group_team_name_help')
+
+    enable_switch_boss: bool = Field(default=False, description='enable_switch_boss_help')
+    boss_group_team: str = Field(default='-1,-1', description='boss_group_team_help')
+    enable_switch_boss_by_name: bool = Field(default=False, description='enable_switch_boss_by_name_help')
+    boss_group_team_name: str = Field(default='', description='boss_group_team_name_help')
+
+    enable_switch_ap100: bool = Field(default=False, description='enable_switch_ap100_help')
+    ap100_group_team: str = Field(default='-1,-1', description='ap100_group_team_help')
+    enable_switch_ap100_by_name: bool = Field(default=False, description='enable_switch_ap100_by_name_help')
+    ap100_group_team_name: str = Field(default='', description='ap100_group_team_name_help')
 
 
     # @model_validator(mode='after')
     # @model_validator(mode='after')
     def validate_switch_soul(self):
     def validate_switch_soul(self):
@@ -75,25 +75,25 @@ class SwitchSoulConfig(BaseModel):
 
 
 
 
 class GeneralBattleConfig(BaseModel):
 class GeneralBattleConfig(BaseModel):
-    enable_pass_preset: bool = Field(default=False, description='是否切换门票爬塔预设, 仅数字切换御魂可用')
-    enable_pass_green: bool = Field(default=False, description='是否开启门票爬塔绿标')
-    pass_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='门票爬塔绿标位置')
-    enable_pass_anti_detect: bool = Field(default=False, description='门票爬塔战斗过程是否随机点击或滑动')
-
-    enable_ap_preset: bool = Field(default=False, description='是否切换体力爬塔预设, 仅数字切换御魂可用')
-    enable_ap_green: bool = Field(default=False, description='是否开启体力爬塔绿标')
-    ap_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='体力爬塔绿标位置')
-    enable_ap_anti_detect: bool = Field(default=False, description='体力爬塔战斗过程是否随机点击或滑动')
-
-    enable_boss_preset: bool = Field(default=False, description='是否切换boss爬塔预设, 仅数字切换御魂可用')
-    enable_boss_green: bool = Field(default=False, description='是否开启boss爬塔绿标')
-    boss_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='boss爬塔绿标位置')
-    enable_boss_anti_detect: bool = Field(default=False, description='boss爬塔战斗过程是否随机点击或滑动')
-
-    enable_ap100_preset: bool = Field(default=False, description='是否切换100体爬塔预设, 仅数字切换御魂可用')
-    enable_ap100_green: bool = Field(default=False, description='是否开启100体爬塔绿标')
-    ap100_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='100体爬塔绿标位置')
-    enable_ap100_anti_detect: bool = Field(default=False, description='100体爬塔战斗过程是否随机点击或滑动')
+    enable_pass_preset: bool = Field(default=False, description='enable_pass_preset_help')
+    enable_pass_green: bool = Field(default=False, description='enable_pass_green_help')
+    pass_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='pass_green_mark_help')
+    enable_pass_anti_detect: bool = Field(default=False, description='enable_pass_anti_detect_help')
+
+    enable_ap_preset: bool = Field(default=False, description='enable_ap_preset_help')
+    enable_ap_green: bool = Field(default=False, description='enable_ap_green_help')
+    ap_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='ap_green_mark_help')
+    enable_ap_anti_detect: bool = Field(default=False, description='enable_ap_anti_detect_help')
+
+    enable_boss_preset: bool = Field(default=False, description='enable_boss_preset_help')
+    enable_boss_green: bool = Field(default=False, description='enable_boss_green_help')
+    boss_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='boss_green_mark_help')
+    enable_boss_anti_detect: bool = Field(default=False, description='enable_boss_anti_detect_help')
+
+    enable_ap100_preset: bool = Field(default=False, description='enable_ap100_preset_help')
+    enable_ap100_green: bool = Field(default=False, description='enable_ap100_green_help')
+    ap100_green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='ap100_green_mark_help')
+    enable_ap100_anti_detect: bool = Field(default=False, description='enable_ap100_anti_detect_help')
 
 
 
 
 class ActivityShikigami(ConfigBase):
 class ActivityShikigami(ConfigBase):

+ 3 - 3
tasks/ActivityShikigami/script_task.py

@@ -211,7 +211,7 @@ class ScriptTask(StateMachine, GameUi, BaseActivity, SwitchSoul, ActivityShikiga
             if self.start_battle():
             if self.start_battle():
                 continue
                 continue
 
 
-        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=1)
+        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=4.5)
 
 
     def _run_ap(self):
     def _run_ap(self):
         """
         """
@@ -244,7 +244,7 @@ class ScriptTask(StateMachine, GameUi, BaseActivity, SwitchSoul, ActivityShikiga
             if self.start_battle():
             if self.start_battle():
                 continue
                 continue
 
 
-        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=1)
+        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=4.5)
 
 
     def _run_boss(self):
     def _run_boss(self):
         """
         """
@@ -269,7 +269,7 @@ class ScriptTask(StateMachine, GameUi, BaseActivity, SwitchSoul, ActivityShikiga
             if self.start_battle():
             if self.start_battle():
                 continue
                 continue
 
 
-        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_BOSS, interval=1)
+        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_BOSS, interval=4.5)
 
 
     def _run_ap100(self):
     def _run_ap100(self):
         """
         """

+ 7 - 1
tasks/Component/GeneralBattle/battle_wait.py

@@ -505,6 +505,9 @@ class BattleWait(BaseTask, GeneralBattleAssets):
         return RuleClickExclude(inputs, name='exclude_click_activity', strategy='rejection', distribution='uniform')
         return RuleClickExclude(inputs, name='exclude_click_activity', strategy='rejection', distribution='uniform')
 
 
     def _bw_success_activity(self, bw_ctx: BattleWaitContext) -> HookSignal:
     def _bw_success_activity(self, bw_ctx: BattleWaitContext) -> HookSignal:
+        """
+        战斗结算是有 “获得奖励” 的适用
+        """
         if not self.appear(self.I_UI_REWARD):
         if not self.appear(self.I_UI_REWARD):
             return HookSignal.CONTINUE
             return HookSignal.CONTINUE
         self.screenshot()
         self.screenshot()
@@ -527,7 +530,10 @@ class BattleWait(BaseTask, GeneralBattleAssets):
                     self.device.click(x=x, y=y, control_name='reward_item')
                     self.device.click(x=x, y=y, control_name='reward_item')
                     continue
                     continue
                 self.click(self.exclude_click_activity, interval=1.5)
                 self.click(self.exclude_click_activity, interval=1.5)
-            else:
+            elif not self.appear(self.I_END_FIX_2):
+                self.screenshot()
+                if self.appear(self.I_UI_REWARD) or self.appear(self.I_END_FIX_2):
+                    continue
                 logger.info('Get all reward')
                 logger.info('Get all reward')
                 bw_ctx.success = True
                 bw_ctx.success = True
                 bw_ctx.completion = True
                 bw_ctx.completion = True