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

Merge pull request #318 from roarhill/dev

fix(Dokan): change assets.py from manually wrote version to auto generated(by assets_extract.py) version
huangrunheng 2 лет назад
Родитель
Сommit
93a3d3b11a
4 измененных файлов с 47 добавлено и 10 удалено
  1. 33 1
      config/template.json
  2. 6 1
      tasks/Dokan/assets.py
  3. 1 1
      tasks/Dokan/res/list.json
  4. 7 7
      tasks/Dokan/script_task.py

+ 33 - 1
config/template.json

@@ -889,5 +889,37 @@
       "kirin_group_team": "-1,-1",
       "netherworld_group_team": "-1,-1"
     }
-  }
+  },
+  "dokan": {
+    "scheduler": {
+      "enable": true,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "19:00:00"
+    },
+    "dokan_config": {
+      "dokan_attack_priority": 0,
+      "dokan_auto_cheering_while_cd": false,
+      "random_delay": false,
+      "anti_detect_click_fixed_random_area": false
+    },
+    "general_battle_config": {
+      "lock_team_enable": false,
+      "preset_enable": true,
+      "preset_group": 1,
+      "preset_team": 1,
+      "green_enable": true,
+      "green_mark": "green_left4",
+      "random_click_swipt_enable": false
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "1,1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
+    }
+  } 
 }

+ 6 - 1
tasks/Dokan/assets.py

@@ -88,7 +88,7 @@ class DokanAssets:
 
 	# List Rule Assets
 	# 这个是当前活跃的竂活动列表界面 
-	L_LAYER_LIST = RuleList(folder="./tasks/Dokan/res", direction="vertical", mode="ocr", roi_back=(35,157,37,250), size=(42, 27), 
+	L_RYOU_ACTIVITY_LIST = RuleList(folder="./tasks/Dokan/res", direction="vertical", mode="ocr", roi_back=(35,157,37,250), size=(42, 27), 
 					 array=["道馆", "首领", "狭间"])
 
 
@@ -105,3 +105,8 @@ class DokanAssets:
 	O_DOKAN_SUCCEEDED = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Full", method="Default", keyword="关闭", name="dokan_succeeded")
 
 
+	# Click Rule Assets
+	# 选择第一个寮 
+	C_SELECT_FIRST_RYOU = RuleClick(roi_front=(1148,138,21,22), roi_back=(1148,138,21,22), name="select_first_ryou")
+
+

+ 1 - 1
tasks/Dokan/res/list.json

@@ -1,5 +1,5 @@
 {
-    "name": "layer_list",
+    "name": "ryou_activity_list",
     "direction": "vertical",
     "type": "ocr",
     "roiBack": "35,157,37,250",

+ 7 - 7
tasks/Dokan/script_task.py

@@ -72,11 +72,11 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, DokanAssets):
 
     @cached_property
     def _attack_priorities(self) -> list:
-        return [self.I_RYOU_DOKAN_PRIORITY_0,
-                self.I_RYOU_DOKAN_PRIORITY_1,
-                self.I_RYOU_DOKAN_PRIORITY_2,
-                self.I_RYOU_DOKAN_PRIORITY_3,
-                self.I_RYOU_DOKAN_PRIORITY_4]
+        return [self.I_RYOU_DOKAN_ATTACK_PRIORITY_0,
+                self.I_RYOU_DOKAN_ATTACK_PRIORITY_1,
+                self.I_RYOU_DOKAN_ATTACK_PRIORITY_2,
+                self.I_RYOU_DOKAN_ATTACK_PRIORITY_3,
+                self.I_RYOU_DOKAN_ATTACK_PRIORITY_4]
 
     def run(self):
         """ 道馆主函数
@@ -153,7 +153,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, DokanAssets):
                 # 战斗
                 success = self.dokan_battle(cfg)
                 # 战斗结束后,随便点三下,确保跳过各种结算画面
-                self.click(click=self.C_DOKAN_READY_FOR_BATLLE, interval=1.5)
+                self.click(click=self.C_DOKAN_READY_FOR_BATTLE, interval=1.5)
                 self.click(click=self.C_DOKAN_RANDOM_CLICK_AREA2, interval=2.2)
                 self.click(click=self.C_DOKAN_RANDOM_CLICK_AREA3, interval=1.8)
                 # 每次战斗结束都重置绿标
@@ -297,7 +297,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, DokanAssets):
         logger.hr('Try to choose attack priority')
         max_try = 5
 
-        if not self.appear_then_click(self.I_RYOU_DOKAN_PRIORITY, interval=2):
+        if not self.appear_then_click(self.I_RYOU_DOKAN_ATTACK_PRIORITY, interval=2):
             logger.error(f"can not find dokan priority option button, choose attack priority process skipped")
             return False