Browse Source

Merge pull request #575 from runhey/dev

Dev
huangrunheng 1 year ago
parent
commit
d5a8a454b5
57 changed files with 916 additions and 252 deletions
  1. 353 96
      config/template.json
  2. 5 0
      module/atom/image.py
  3. 3 3
      module/config/config.py
  4. 2 2
      module/config/utils.py
  5. BIN
      tasks/ActivityShikigami/0110/0110_n_confirm.png
  6. 26 0
      tasks/ActivityShikigami/0110/click.json
  7. BIN
      tasks/ActivityShikigami/as/as_ap.png
  8. BIN
      tasks/ActivityShikigami/as/as_ap_activity.png
  9. BIN
      tasks/ActivityShikigami/as/as_battle.png
  10. BIN
      tasks/ActivityShikigami/as/as_fire.png
  11. BIN
      tasks/ActivityShikigami/as/as_shi.png
  12. BIN
      tasks/ActivityShikigami/as/as_switch.png
  13. 11 11
      tasks/ActivityShikigami/as/image.json
  14. 4 4
      tasks/ActivityShikigami/as/ocr.json
  15. 19 8
      tasks/ActivityShikigami/assets.py
  16. 12 3
      tasks/ActivityShikigami/config.py
  17. 13 8
      tasks/ActivityShikigami/script_task.py
  18. 1 0
      tasks/Component/Costume/config.py
  19. 6 1
      tasks/Component/Costume/costume_base.py
  20. 9 0
      tasks/Component/CostumeBattle/assets.py
  21. BIN
      tasks/Component/CostumeBattle/battle9/battle9_exit_9.png
  22. BIN
      tasks/Component/CostumeBattle/battle9/battle9_friends_9.png
  23. BIN
      tasks/Component/CostumeBattle/battle9/battle9_local_9.png
  24. 29 0
      tasks/Component/CostumeBattle/battle9/image.json
  25. 1 1
      tasks/Component/CostumeBattle/costume_test_battle.py
  26. 1 1
      tasks/Component/GeneralBuff/general_buff.py
  27. 7 5
      tasks/Component/GeneralInvite/assets.py
  28. 7 1
      tasks/Component/GeneralInvite/general_invite.py
  29. BIN
      tasks/Component/GeneralInvite/gi/gi_back_yellow_sea.png
  30. BIN
      tasks/Component/GeneralInvite/gi/gi_fire_fail_sea.png
  31. BIN
      tasks/Component/GeneralInvite/gi/gi_fire_sea.png
  32. BIN
      tasks/Component/GeneralInvite/gi/gi_invite_ensure.png
  33. 17 8
      tasks/Component/GeneralInvite/gi/image.json
  34. 1 1
      tasks/Component/SwitchSoul/switch_soul.py
  35. 1 0
      tasks/Component/config_scheduler.py
  36. 17 3
      tasks/EternitySea/assets.py
  37. 3 1
      tasks/EternitySea/config.py
  38. BIN
      tasks/EternitySea/res/es_eternity_sea.png
  39. 63 27
      tasks/EternitySea/res/image.json
  40. 25 0
      tasks/EternitySea/res/list.json
  41. BIN
      tasks/EternitySea/res/res_back_bottom.png
  42. BIN
      tasks/EternitySea/res/res_eternity_sea.png
  43. 0 0
      tasks/EternitySea/res/res_eternity_sea_fire.png
  44. BIN
      tasks/EternitySea/res/res_eternitysea_unlock.png
  45. 0 0
      tasks/EternitySea/res/res_form_team.png
  46. BIN
      tasks/EternitySea/res/res_neweternitysea_lock.png
  47. BIN
      tasks/EternitySea/res/res_pet_present.png
  48. 196 18
      tasks/EternitySea/script_task.py
  49. 10 1
      tasks/Exploration/base.py
  50. 33 26
      tasks/GoldYoukai/script_task.py
  51. BIN
      tasks/HeroTest/as/as_start_challenge.png
  52. 9 0
      tasks/HeroTest/as/image.json
  53. 2 0
      tasks/HeroTest/assets.py
  54. 25 18
      tasks/HeroTest/script_task.py
  55. 2 2
      tasks/Orochi/config.py
  56. 2 2
      tasks/Orochi/script_task.py
  57. 1 1
      tasks/base_task.py

+ 353 - 96
config/template.json

@@ -32,7 +32,12 @@
       "priority": 0,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:05:00"
+      "server_update": "09:05:00",
+      "float_time": "00:00:00"
+    },
+    "tasks_config_reset": {
+      "reset_task_datetime_enable": false,
+      "reset_task_datetime": "2023-01-01 00:00:00"
     },
     "harvest_config": {
       "enable": true,
@@ -42,16 +47,26 @@
       "enable_mail": true,
       "enable_soul": true,
       "enable_ap": true
+    },
+    "login_character_config": {
+      "character": ""
     }
   },
   "global_game": {
     "emergency": {
       "friend_invitation": "accept",
-      "invitation_detect_interval": 5,
       "when_network_abnormal": "wait_10s",
       "when_network_error": "restart",
       "home_client_clear": true
     },
+    "costume_config": {
+      "costume_main_type": "costume_main",
+      "costume_realm_type": "costume_realm_default",
+      "costume_theme_type": "costume_theme_default",
+      "costume_shikigami_type": "costume_shikigami_default",
+      "costume_sign_type": "costume_sign_default",
+      "costume_battle_type": "costume_battle_default"
+    },
     "team_flow": {
       "enable": false,
       "broker": "",
@@ -69,10 +84,14 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "boss": {
-      "boss_number": 3
+      "boss_number": 3,
+      "boss_reward": false,
+      "reward_floor": "一星",
+      "use_collect": false
     },
     "general_battle": {
       "lock_team_enable": false,
@@ -98,7 +117,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     }
   },
   "gold_youkai": {
@@ -108,7 +128,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "gold_youkai": {
       "buff_gold_50_click": false,
@@ -129,7 +150,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "nian_config": {
       "buff_gold_50_click": false,
@@ -143,7 +165,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "raid_config": {
       "number_attack": 30,
@@ -177,12 +200,16 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "raid_config": {
-      "raid_mode": "attack_all",
-      "attack_number": "all",
-      "ryou_access": "yes"
+      "limit_time": "00:30:00",
+      "limit_count": 50,
+      "next_ryoutoppa_time": "07:00:00",
+      "skip_difficult": true,
+      "ryou_access": false,
+      "random_delay": false
     },
     "general_battle_config": {
       "lock_team_enable": false,
@@ -208,7 +235,8 @@
       "priority": 2,
       "success_interval": "00 06:00:00",
       "failure_interval": "00 06:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "utilize_config": {
       "utilize_rule": "default",
@@ -229,7 +257,8 @@
       "priority": 2,
       "success_interval": "01 00:00:00",
       "failure_interval": "00 10:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "activation_config": {
       "card_rule": "auto",
@@ -250,14 +279,14 @@
     },
     "demon_soul_config": {
       "enable": false,
-      "demon_kiryou_utahime": "-1,-1",
-      "demon_kiryou_utahime_supplementary": "-1,-1",
-      "demon_shinkirou": "-1,-1",
-      "demon_tsuchigumo": "-1,-1",
-      "demon_gashadokuro": "-1,-1",
-      "demon_namazu": "-1,-1",
-      "demon_oboroguruma": "-1,-1",
-      "demon_nightly_aramitama": "-1,-1"
+      "demon_kiryou_utahime": "group,team",
+      "demon_kiryou_utahime_supplementary": "group,team",
+      "demon_shinkirou": "group,team",
+      "demon_tsuchigumo": "group,team",
+      "demon_gashadokuro": "group,team",
+      "demon_namazu": "group,team",
+      "demon_oboroguruma": "group,team",
+      "demon_nightly_aramitama": "group,team"
     }
   },
   "daily_trifles": {
@@ -267,12 +296,14 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "trifles_config": {
       "one_summon": false,
       "guild_wish": false,
       "friend_love": false,
+      "luck_msg": false,
       "store_sign": false
     }
   },
@@ -283,7 +314,8 @@
       "priority": 5,
       "success_interval": "00 06:00:00",
       "failure_interval": "00 06:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "talisman": {
       "level_reward": "金币/勾玉"
@@ -296,7 +328,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "pets_config": {
       "pets_happy": true,
@@ -310,7 +343,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "simple_tidy": {
       "greed_maneki": false
@@ -323,7 +357,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "delegation_config": {
       "miyoshino_painting": false,
@@ -341,16 +376,31 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "exploration_config": {
       "buff_gold_50_click": false,
       "buff_gold_100_click": false,
-      "attack_number": "7",
-      "current_exploration_times": "0",
+      "buff_exp_50_click": false,
+      "buff_exp_100_click": false,
+      "user_status": "alone",
+      "limit_time": "00:30:00",
+      "minions_cnt": "30",
       "exploration_level": "第二十八章",
       "auto_rotate": "不",
-      "choose_rarity": "N卡"
+      "choose_rarity": "N卡",
+      "up_type": "up_all"
+    },
+    "scrolls": {
+      "scrolls_enable": false,
+      "scrolls_cd": "00 00:30:00",
+      "scrolls_threshold": "25"
+    },
+    "invite_config": {
+      "friend_1": "",
+      "find_mode": "auto_find",
+      "wait_time": "00:02:00"
     },
     "general_battle_config": {
       "lock_team_enable": false,
@@ -376,10 +426,21 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "wanted_quests_config": {
-      "before_end": "00:00:00"
+      "before_end": "00:00:00",
+      "invite_friend_name": "",
+      "cooperation_type": "Any",
+      "battle_priority": "挑战 > 秘闻 > 探索"
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
     }
   },
   "tako": {
@@ -389,7 +450,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "tako_config": {
       "enable": false,
@@ -413,7 +475,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "orochi_config": {
       "user_status": "leader",
@@ -444,7 +507,10 @@
       "switch_group_team": "-1,-1",
       "enable_switch_by_name": false,
       "group_name": "",
-      "team_name": ""
+      "team_name": "",
+      "auto_switch_soul": false,
+      "eleven_switch": "-1,-1",
+      "twelve_switch": "-1,-1"
     }
   },
   "orochi_moans": {
@@ -454,7 +520,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     }
   },
   "sougenbi": {
@@ -464,7 +531,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "sougenbi_config": {
       "sougenbi_class": "痴",
@@ -500,7 +568,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "fallen_sun_config": {
       "user_status": "leader",
@@ -540,13 +609,67 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "eternity_sea_config": {
       "user_status": "leader",
       "layer": "肆层",
       "limit_time": "00:30:00",
       "limit_count": 50
+    },
+    "general_battle_config": {
+      "lock_team_enable": false,
+      "preset_enable": false,
+      "preset_group": 1,
+      "preset_team": 1,
+      "green_enable": false,
+      "green_mark": "green_left1",
+      "random_click_swipt_enable": false
+    },
+    "switch_soul_config_1": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
+    },
+    "switch_soul_config_2": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
+    },
+    "invite_config": {
+      "invite_number": "one",
+      "friend_1": "",
+      "friend_2": "",
+      "find_mode": "auto_find",
+      "wait_time": "00:02:00",
+      "default_invite": true
+    }
+  },
+  "six_realms": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
+    },
+    "six_realms_gate": {
+      "limit_time": "00:30:00",
+      "limit_count": 1
     }
   },
   "activity_shikigami": {
@@ -556,14 +679,17 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "general_climb": {
       "limit_time": "00:30:00",
       "limit_count": 50,
       "ap_game_max": 300,
       "ap_mode": "ap_activity",
-      "activity_toggle": false
+      "activity_toggle": false,
+      "active_souls_clean": false,
+      "random_sleep": false
     },
     "general_battle": {
       "lock_team_enable": false,
@@ -573,12 +699,20 @@
       "green_enable": false,
       "green_mark": "green_left1",
       "random_click_swipt_enable": false
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
     }
   },
   "meta_demon": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
       "interval": "00 03:00:00"
     },
     "meta_demon_config": {
@@ -586,6 +720,50 @@
       "extreme_notify": false
     }
   },
+  "frog_boss": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "frog_boss_config": {
+      "before_end_frog": "00:15:00",
+      "strategy_frog": "frog_majority"
+    }
+  },
+  "float_parade": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "03 00:00:00",
+      "failure_interval": "03 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "float_parade": {
+      "level_reward": "金币/勾玉"
+    }
+  },
+  "quiz": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "quiz_config": {
+      "quiz_cnt": 1,
+      "quiz_per_round": 150
+    }
+  },
   "bondling_fairyland": {
     "scheduler": {
       "enable": false,
@@ -593,7 +771,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "bondling_config": {
       "bondling_mode": "mode_1",
@@ -629,7 +808,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "evo_zone_config": {
       "user_status": "leader",
@@ -655,6 +835,13 @@
       "green_enable": false,
       "green_mark": "green_left1",
       "random_click_swipt_enable": false
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
     }
   },
   "goryou_realm": {
@@ -664,7 +851,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "goryou_config": {
       "limit_time": "00:30:00",
@@ -688,6 +876,78 @@
       "team_name": ""
     }
   },
+  "hyakkiyakou": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "hyakkiyakou_config": {
+      "hya_limit_time": "00:20:00",
+      "hya_limit_count": 10,
+      "hya_invite_friend": false,
+      "hya_auto_bean": false,
+      "hya_priorities": "",
+      "hya_sp": 1.0,
+      "hya_ssr": 1.0,
+      "hya_sr": 0.7,
+      "hya_r": 0.3,
+      "hya_n": 0.0,
+      "hya_g": 0.0
+    },
+    "hyakkiyakou_models": {
+      "conf_threshold": 0.6,
+      "iou_threshold": 0.7,
+      "model_precision": "FP32",
+      "inference_engine": "Onnxruntime"
+    },
+    "debug_config": {
+      "hya_show": false,
+      "hya_info": false,
+      "continuous_learning": false,
+      "hya_save_result": false,
+      "hya_interval": 300,
+      "hya_screenshot_method": "window_background"
+    }
+  },
+  "hero_test": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "herotest": {
+      "layer": "鬼兵演武",
+      "limit_time": "00:30:00",
+      "limit_count": 100,
+      "exp_50_buff_enable_help": false,
+      "exp_100_buff_enable_help": false
+    },
+    "general_battle": {
+      "lock_team_enable": false,
+      "preset_enable": false,
+      "preset_group": 1,
+      "preset_team": 1,
+      "green_enable": false,
+      "green_mark": "green_left1",
+      "random_click_swipt_enable": false
+    },
+    "switch_soul_config": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
+    }
+  },
   "true_orochi": {
     "scheduler": {
       "enable": false,
@@ -695,11 +955,19 @@
       "priority": 10,
       "success_interval": "07 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "true_orochi_config": {
       "find_true_orochi": true,
       "current_success": 0
+    },
+    "switch_soul": {
+      "enable": false,
+      "switch_group_team": "-1,-1",
+      "enable_switch_by_name": false,
+      "group_name": "",
+      "team_name": ""
     }
   },
   "rich_man": {
@@ -709,7 +977,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "special_room": {
       "enable": false,
@@ -790,7 +1059,8 @@
       "priority": 5,
       "success_interval": "07 00:00:00",
       "failure_interval": "07 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "secret_config": {
       "secret_gold_50": false,
@@ -822,7 +1092,8 @@
       "priority": 5,
       "success_interval": "07 00:00:00",
       "failure_interval": "07 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "trifles": {
       "share_collect": true,
@@ -838,7 +1109,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "shop_config": {
       "time_of_mystery": "00:00:00",
@@ -863,7 +1135,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "duel_config": {
       "switch_all_soul": false,
@@ -881,7 +1154,8 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
     "missions_config": {
       "missions_rule": "契灵 > 觉醒三 > 觉醒二 > 觉醒一 > 御灵三 > 御灵二 > 御灵一 > 御魂二 > 御魂一 > 远远不够",
@@ -895,14 +1169,19 @@
       "priority": 5,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
-      "server_update": "09:00:00"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
+    },
+    "hunt_time": {
+      "kirin_time": "19:00:00",
+      "netherworld_time": "19:00:00"
     },
     "hunt_config": {
       "kirin_group_team": "-1,-1",
       "netherworld_group_team": "-1,-1"
     }
   },
-  "abyss_shadows": {
+  "dokan": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
@@ -912,6 +1191,12 @@
       "server_update": "09:00:00",
       "float_time": "00: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": false,
@@ -929,64 +1214,36 @@
       "team_name": ""
     }
   },
-  "dokan": {
+  "abyss_shadows": {
     "scheduler": {
-      "enable": true,
+      "enable": false,
       "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"
+      "server_update": "09:00:00",
+      "float_time": "00:00:00"
     },
-    "dokan_config": {
-      "dokan_attack_priority": 0,
-      "dokan_auto_cheering_while_cd": false,
-      "random_delay": false,
-      "anti_detect_click_fixed_random_area": false
+    "abyss_shadows_time": {
+      "custom_run_time_friday": "19:00:00",
+      "custom_run_time_saturday": "19:00:00",
+      "custom_run_time_sunday": "19:00:00"
     },
     "general_battle_config": {
       "lock_team_enable": false,
-      "preset_enable": true,
+      "preset_enable": false,
       "preset_group": 1,
       "preset_team": 1,
-      "green_enable": true,
-      "green_mark": "green_left4",
+      "green_enable": false,
+      "green_mark": "green_left1",
       "random_click_swipt_enable": false
     },
     "switch_soul_config": {
       "enable": false,
-      "switch_group_team": "1,1",
+      "switch_group_team": "-1,-1",
       "enable_switch_by_name": false,
       "group_name": "",
       "team_name": ""
-    },
-    "hero_test": {
-      "scheduler": {
-        "enable": false,
-        "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",
-        "float_time": "00:00:00"
-      },
-      "herotest_config": {
-        "layer": "鬼兵演武",
-        "limit_time": "00:30:00",
-        "limit_count": 30,
-        "exp_50_buff_enable_help": false,
-        "exp_100_buff_enable_help": false
-      },
-      "general_battle_config": {
-        "lock_team_enable": false,
-        "preset_enable": false,
-        "preset_group": 1,
-        "preset_team": 1,
-        "green_enable": false,
-        "green_mark": "green_left1",
-        "random_click_swipt_enable": false
-      }
-    }
-    
+    }
   }
-}
+}

+ 5 - 0
module/atom/image.py

@@ -149,6 +149,11 @@ class RuleImage:
 
         source = self.corp(image)
         mat = self.image
+
+        if mat is None or mat.shape[0] == 0 or mat.shape[1] == 0:
+            logger.error(f"Template image is invalid: {mat.shape}") #检测模板尺寸,不合法则不进行匹配,避免两次截图画面完全相同造成模板不合法
+            return True  # 如果模板图像无效,直接返回 True
+
         res = cv2.matchTemplate(source, mat, cv2.TM_CCOEFF_NORMED)
         min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)  # 最小匹配度,最大匹配度,最小匹配度的坐标,最大匹配度的坐标
         # logger.attr(self.name, max_val)

+ 3 - 3
module/config/config.py

@@ -342,16 +342,16 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
         next_run = run
 
         if server and hasattr(scheduler, 'server_update'):
-            # 加入随机浮动时间
+            # 加入随机延迟时间
             float_seconds = (scheduler.float_time.hour * 3600 +
                              scheduler.float_time.minute * 60 +
                              scheduler.float_time.second)
-            random_float = random.randint(-float_seconds, float_seconds)
+            random_float = random.randint(0, float_seconds)
             # 如果有强制运行时间
             if scheduler.server_update == time(hour=9):
                 next_run += timedelta(seconds=random_float)
             else:
-                next_run = parse_tomorrow_server(scheduler.server_update, random_float)
+                next_run = parse_tomorrow_server(scheduler.server_update, scheduler.delay_date, random_float)
 
         # 将这些连接起来,方便日志输出
         kv = dict_to_kv(

+ 2 - 2
module/config/utils.py

@@ -244,7 +244,7 @@ def dict_to_kv(dictionary, allow_none=True):
     return ', '.join([f'{k}={repr(v)}' for k, v in dictionary.items() if allow_none or v is not None])
 
 
-def parse_tomorrow_server(server_update: time, float_seconds: int = 0) -> datetime:
+def parse_tomorrow_server(server_update: time, delay_date: int = 1, float_seconds: int = 0) -> datetime:
     """
     获取明天的日期,给这个日期加上server_update的时间,返回datetime
     :param server_update:
@@ -254,7 +254,7 @@ def parse_tomorrow_server(server_update: time, float_seconds: int = 0) -> dateti
     if isinstance(server_update, str):
         server_update = time.fromisoformat(server_update)
     now = datetime.now()
-    tomorrow = now + timedelta(days=1)
+    tomorrow = now + timedelta(days=delay_date)
     next_run = datetime.combine(tomorrow, server_update)
     
     # 应用浮动时间

BIN
tasks/ActivityShikigami/0110/0110_n_confirm.png


+ 26 - 0
tasks/ActivityShikigami/0110/click.json

@@ -0,0 +1,26 @@
+[
+  {
+    "itemName": "click1",
+    "roiFront": "120,138,130,75",
+    "roiBack": "120,138,130,75",
+    "description": "description"
+  },
+  {
+    "itemName": "click2",
+    "roiFront": "121,234,125,81",
+    "roiBack": "121,234,125,81",
+    "description": "description"
+  },
+  {
+    "itemName": "click3",
+    "roiFront": "126,337,118,77",
+    "roiBack": "126,337,118,77",
+    "description": "description"
+  },
+  {
+    "itemName": "click4",
+    "roiFront": "124,438,126,77",
+    "roiBack": "124,438,126,77",
+    "description": "description"
+  }
+]

BIN
tasks/ActivityShikigami/as/as_ap.png


BIN
tasks/ActivityShikigami/as/as_ap_activity.png


BIN
tasks/ActivityShikigami/as/as_battle.png


BIN
tasks/ActivityShikigami/as/as_fire.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_switch.png


+ 11 - 11
tasks/ActivityShikigami/as/image.json

@@ -2,7 +2,7 @@
   {
     "itemName": "shi",
     "imageName": "as_shi.png",
-    "roiFront": "545,254,33,34",
+    "roiFront": "519,223,33,34",
     "roiBack": "64,115,1110,427",
     "method": "Template matching",
     "threshold": 0.7,
@@ -20,8 +20,8 @@
   {
     "itemName": "battle",
     "imageName": "as_battle.png",
-    "roiFront": "1080,229,35,145",
-    "roiBack": "1028,155,138,315",
+    "roiFront": "668,377,35,145",
+    "roiBack": "613,296,138,315",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "进入爬塔"
@@ -56,8 +56,8 @@
   {
     "itemName": "fire",
     "imageName": "as_fire.png",
-    "roiFront": "1134,579,84,78",
-    "roiBack": "1107,522,142,174",
+    "roiFront": "1133,566,84,78",
+    "roiBack": "1099,522,150,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击战斗"
@@ -65,8 +65,8 @@
   {
     "itemName": "ap",
     "imageName": "as_ap.png",
-    "roiFront": "1127,509,23,24",
-    "roiBack": "1092,487,103,71",
+    "roiFront": "1130,526,23,24",
+    "roiBack": "1092,497,103,71",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "体力按钮"
@@ -74,8 +74,8 @@
   {
     "itemName": "ap_activity",
     "imageName": "as_ap_activity.png",
-    "roiFront": "1124,514,21,21",
-    "roiBack": "1090,500,84,54",
+    "roiFront": "1129,529,21,21",
+    "roiBack": "1101,509,84,54",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "活动体力"
@@ -83,8 +83,8 @@
   {
     "itemName": "switch",
     "imageName": "as_switch.png",
-    "roiFront": "1212,514,23,23",
-    "roiBack": "1200,497,69,56",
+    "roiFront": "1217,527,23,23",
+    "roiBack": "1199,507,69,56",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "切换按键"

+ 4 - 4
tasks/ActivityShikigami/as/ocr.json

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "remain_ap",
-    "roiFront": "1150,673,88,25",
-    "roiBack": "1150,673,88,25",
+    "roiFront": "1139,680,97,25",
+    "roiBack": "1139,680,97,25",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",
@@ -10,8 +10,8 @@
   },
   {
     "itemName": "remain_ap_activity",
-    "roiFront": "909,25,95,30",
-    "roiBack": "909,25,95,30",
+    "roiFront": "717,25,95,30",
+    "roiBack": "717,25,95,30",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",

+ 19 - 8
tasks/ActivityShikigami/assets.py

@@ -10,6 +10,17 @@ from module.atom.list import RuleList
 class ActivityShikigamiAssets: 
 
 
+	# Click Rule Assets
+	# description 
+	C_CLICK1 = RuleClick(roi_front=(120,138,130,75), roi_back=(120,138,130,75), name="click1")
+	# description 
+	C_CLICK2 = RuleClick(roi_front=(121,234,125,81), roi_back=(121,234,125,81), name="click2")
+	# description 
+	C_CLICK3 = RuleClick(roi_front=(126,337,118,77), roi_back=(126,337,118,77), name="click3")
+	# description 
+	C_CLICK4 = RuleClick(roi_front=(124,438,126,77), roi_back=(124,438,126,77), name="click4")
+
+
 	# Image Rule Assets
 	# description 
 	I_N_BATTLE = RuleImage(roi_front=(131,164,86,86), roi_back=(119,50,1075,635), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/0110/0110_n_battle.png")
@@ -34,11 +45,11 @@ class ActivityShikigamiAssets:
 
 	# Image Rule Assets
 	# 进入活动 
-	I_SHI = RuleImage(roi_front=(545,254,33,34), roi_back=(64,115,1110,427), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
+	I_SHI = RuleImage(roi_front=(519,223,33,34), roi_back=(64,115,1110,427), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
 	# 左上角返回 
 	I_BACK_GREEN = RuleImage(roi_front=(23,27,44,44), roi_back=(23,27,44,44), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_back_green.png")
 	# 进入爬塔 
-	I_BATTLE = RuleImage(roi_front=(1080,229,35,145), roi_back=(1028,155,138,315), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
+	I_BATTLE = RuleImage(roi_front=(668,377,35,145), roi_back=(613,296,138,315), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
 	# 归鹿之途 
 	I_DRUM = RuleImage(roi_front=(885,310,29,145), roi_back=(860,244,87,232), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_drum.png")
 	# 上锁图标 
@@ -46,13 +57,13 @@ class ActivityShikigamiAssets:
 	# 还未上锁图片 
 	I_UNLOCK = RuleImage(roi_front=(823,654,28,28), roi_back=(776,610,112,87), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
 	# 点击战斗 
-	I_FIRE = RuleImage(roi_front=(1134,579,84,78), roi_back=(1107,522,142,174), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
+	I_FIRE = RuleImage(roi_front=(1133,566,84,78), roi_back=(1099,522,150,174), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
 	# 体力按钮 
-	I_AP = RuleImage(roi_front=(1127,509,23,24), roi_back=(1092,487,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
+	I_AP = RuleImage(roi_front=(1130,526,23,24), roi_back=(1092,497,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
 	# 活动体力 
-	I_AP_ACTIVITY = RuleImage(roi_front=(1124,514,21,21), roi_back=(1090,500,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
+	I_AP_ACTIVITY = RuleImage(roi_front=(1129,529,21,21), roi_back=(1101,509,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
 	# 切换按键 
-	I_SWITCH = RuleImage(roi_front=(1212,514,23,23), roi_back=(1200,497,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
+	I_SWITCH = RuleImage(roi_front=(1217,527,23,23), roi_back=(1199,507,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
 	# 购买活动的体力 
 	I_BUY_JADE = RuleImage(roi_front=(1004,192,38,42), roi_back=(836,619,38,42), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_buy_jade.png")
 	# 增加到最大 
@@ -63,9 +74,9 @@ class ActivityShikigamiAssets:
 
 	# Ocr Rule Assets
 	# 体力的数量检测 
-	O_REMAIN_AP = RuleOcr(roi=(1150,673,88,25), area=(1150,673,88,25), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
+	O_REMAIN_AP = RuleOcr(roi=(1139,680,97,25), area=(1139,680,97,25), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
-	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(909,25,95,30), area=(909,25,95,30), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
+	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(717,25,95,30), area=(717,25,95,30), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
 	# 还有多少次购买体力的机会 
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 

+ 12 - 3
tasks/ActivityShikigami/config.py

@@ -1,6 +1,7 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
+from enum import Enum
 from datetime import time, timedelta
 from pydantic import BaseModel, Field
 
@@ -10,14 +11,22 @@ from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase, TimeDelta
 from tasks.Component.BaseActivity.config_activity import GeneralClimb
 
+
+class ShikigamiType(str, Enum):
+    FOOD_TYPE_1 = 'shikigami_type_1'
+    FOOD_TYPE_2 = 'shikigami_type_2'
+    FOOD_TYPE_3 = 'shikigami_type_3'
+    FOOD_TYPE_4 = 'shikigami_type_4'
+
 class ShikigamiConfig(BaseModel):
-    limit_time: TimeDelta = Field(default=TimeDelta(hours=0, minutes=30, seconds=0), description='limit_time_help')
-    limit_count: int = Field(default=10, description='limit_count_help')
+    # limit_time: TimeDelta = Field(default=TimeDelta(hours=0, minutes=30, seconds=0), description='limit_time_help')
+    # limit_count: int = Field(default=10, description='limit_count_help')
+    food_type: ShikigamiType = Field(default=ShikigamiType.FOOD_TYPE_1, description='food_type_help')
 
 
 class ActivityShikigami(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
-    # shikigami: ShikigamiConfig = Field(default_factory=ShikigamiConfig)
+    shikigami: ShikigamiConfig = Field(default_factory=ShikigamiConfig)
     general_climb: GeneralClimb = Field(default_factory=GeneralClimb)
     general_battle: GeneralBattleConfig = Field(default_factory=GeneralBattleConfig)
     switch_soul_config: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)

+ 13 - 8
tasks/ActivityShikigami/script_task.py

@@ -46,12 +46,9 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
         self.ui_goto(page_main)
         self.home_main()
 
-        # # 2024-11-06 ---------------------start
-        config.general_climb.ap_mode = ApMode.AP_GAME
         # 选择是游戏的体力还是活动的体力
         current_ap = config.general_climb.ap_mode
-        # self.switch(current_ap)
-        # # 2024-11-06 ---------------------end
+        self.switch(current_ap)
 
         # 设定是否锁定阵容
         if config.general_battle.lock_team_enable:
@@ -118,6 +115,8 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
                     continue
                 if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
                     continue
+                if self.appear_then_click(self.I_N_CONFIRM, interval=1):
+                    continue
 
             if self.run_general_battle(config=config.general_battle):
                 logger.info("General battle success")
@@ -139,10 +138,16 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
             self.screenshot()
             if self.appear(self.I_FIRE):
                 break
-            # 2024-04-04 --------------start
-            if self.appear_then_click(self.I_N_BATTLE, interval=1):
-                continue
-            # 2024-04-04 --------------end
+            # 2024-12-04 --------------start
+            from tasks.ActivityShikigami.config import ShikigamiType
+            map_click = {
+                ShikigamiType.FOOD_TYPE_1: self.C_CLICK1,
+                ShikigamiType.FOOD_TYPE_2: self.C_CLICK2,
+                ShikigamiType.FOOD_TYPE_3: self.C_CLICK3,
+                ShikigamiType.FOOD_TYPE_4: self.C_CLICK4,
+            }
+            self.click(map_click[self.config.model.activity_shikigami.shikigami.food_type], interval=4)
+            # 2024-12-04 --------------end
             if self.appear_then_click(self.I_SHI, interval=1):
                 continue
             if self.appear_then_click(self.I_DRUM, interval=1):

+ 1 - 0
tasks/Component/Costume/config.py

@@ -48,6 +48,7 @@ class BattleType(str, Enum):
     COSTUME_BATTLE_6 = 'costume_battle_6'  # 桂馥金秋
     COSTUME_BATTLE_7 = 'costume_battle_7'  # 笼梦之境
     COSTUME_BATTLE_8 = 'costume_battle_8'  # 藏金台阁
+    COSTUME_BATTLE_9 = 'costume_battle_9'  # 莲华圣域
 
 
 

+ 6 - 1
tasks/Component/Costume/costume_base.py

@@ -116,6 +116,11 @@ battle_theme_model = {
         'I_DE_WIN': 'I_DE_WIN_8',
         'I_FALSE': 'I_FALSE_8',
     },
+    BattleType.COSTUME_BATTLE_9: {
+        'I_LOCAL': 'I_LOCAL_9',
+        'I_EXIT': 'I_EXIT_9',
+        'I_FRIENDS': 'I_FRIENDS_9',
+    },
 }
 
 
@@ -176,4 +181,4 @@ class CostumeBase:
 
 if __name__ == '__main__':
     c = CostumeBase()
-    c.check_costume_main(MainType.COSTUME_MAIN_1)
+    c.check_costume_main(MainType.COSTUME_MAIN_2)

+ 9 - 0
tasks/Component/CostumeBattle/assets.py

@@ -88,3 +88,12 @@ class CostumeBattleAssets:
 	I_FALSE_8 = RuleImage(roi_front=(384,106,100,100), roi_back=(346,96,184,120), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle8/battle8_false_8.png")
 
 
+	# Image Rule Assets
+	# 左上角退出 
+	I_EXIT_9 = RuleImage(roi_front=(20,17,35,34), roi_back=(20,17,35,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle9/battle9_exit_9.png")
+	# 左上角好友 
+	I_FRIENDS_9 = RuleImage(roi_front=(93,15,31,36), roi_back=(93,15,31,36), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle9/battle9_friends_9.png")
+	# 指针 
+	I_LOCAL_9 = RuleImage(roi_front=(114,489,37,37), roi_back=(114,489,37,37), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle9/battle9_local_9.png")
+
+

BIN
tasks/Component/CostumeBattle/battle9/battle9_exit_9.png


BIN
tasks/Component/CostumeBattle/battle9/battle9_friends_9.png


BIN
tasks/Component/CostumeBattle/battle9/battle9_local_9.png


+ 29 - 0
tasks/Component/CostumeBattle/battle9/image.json

@@ -0,0 +1,29 @@
+[
+  {
+    "itemName": "exit_9",
+    "imageName": "battle9_exit_9.png",
+    "roiFront": "20,17,35,34",
+    "roiBack": "20,17,35,34",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左上角退出"
+  },
+  {
+    "itemName": "friends_9",
+    "imageName": "battle9_friends_9.png",
+    "roiFront": "93,15,31,36",
+    "roiBack": "93,15,31,36",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左上角好友"
+  },
+  {
+    "itemName": "local_9",
+    "imageName": "battle9_local_9.png",
+    "roiFront": "114,489,37,37",
+    "roiBack": "114,489,37,37",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "指针"
+  }
+]

+ 1 - 1
tasks/Component/CostumeBattle/costume_test_battle.py

@@ -74,5 +74,5 @@ if __name__ == '__main__':
     c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)
-    t.set_costume(BattleType.COSTUME_BATTLE_1)
+    t.set_costume(BattleType.COSTUME_BATTLE_9)
     t.run()

+ 1 - 1
tasks/Component/GeneralBuff/general_buff.py

@@ -61,7 +61,7 @@ class GeneralBuff(BaseTask, GeneralBuffAssets):
         self.reject_invite()
         self.screenshot()
         area = buff.ocr(self.device.image)
-        if area == tuple([0, 0, 0, 0]):
+        if area == tuple([432.0, 143.0, 325.0, 21.0]):
             logger.info('No gold 50 buff')
             return None
 

+ 7 - 5
tasks/Component/GeneralInvite/assets.py

@@ -26,9 +26,9 @@ class GeneralInviteAssets:
 	# 如果是到时间会退出房间,这个右边显示一个匹配的图片 
 	I_MATCHING = RuleImage(roi_front=(51,574,52,114), roi_back=(51,574,52,114), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_matching.png")
 	# 永生之海挑战(还未有队友的图片) 
-	I_FIRE_FAIL_SEA = RuleImage(roi_front=(1160,585,100,100), roi_back=(1160,585,100,100), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_fail_sea.png")
+	I_FIRE_FAIL_SEA = RuleImage(roi_front=(1160,585,100,70), roi_back=(1160,585,100,70), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_fail_sea.png")
 	# description 
-	I_FIRE_SEA = RuleImage(roi_front=(1160,586,100,97), roi_back=(1160,586,100,97), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_sea.png")
+	I_FIRE_SEA = RuleImage(roi_front=(1160,586,100,68), roi_back=(1160,586,100,68), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_sea.png")
 	# description 
 	I_LOCK_SEA = RuleImage(roi_front=(781,658,27,28), roi_back=(781,658,27,28), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_lock_sea.png")
 	# 永生之海 没有锁定队伍的图片 
@@ -46,9 +46,9 @@ class GeneralInviteAssets:
 	# 左上角退出 
 	I_BACK_YELLOW = RuleImage(roi_front=(19,13,58,55), roi_back=(19,13,58,55), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_back_yellow.png")
 	# 点击邀请 
-	I_INVITE_ENSURE = RuleImage(roi_front=(500,541,132,60), roi_back=(478,523,378,92), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_invite_ensure.png")
+	I_INVITE_ENSURE = RuleImage(roi_front=(710,544,132,60), roi_back=(710,544,132,60), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_invite_ensure.png")
 	# 判断是否点中好友了 
-	I_SELECTED = RuleImage(roi_front=(895,373,33,32), roi_back=(380,157,568,350), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_selected.png")
+	I_SELECTED = RuleImage(roi_front=(895,373,33,32), roi_back=(895,373,33,32), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_selected.png")
 	# 用来判断当前的列表是哪儿的 
 	I_FLAG_1_ON = RuleImage(roi_front=(354,126,62,21), roi_back=(354,126,62,21), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_flag_1_on.png")
 	# description 
@@ -90,7 +90,9 @@ class GeneralInviteAssets:
 	# 所有的组队界面都有加成 
 	I_GI_BUFF = RuleImage(roi_front=(794,38,46,42), roi_back=(794,38,46,42), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_gi_buff.png")
 	# 三人御魂组队左上角的协站队伍 
-	I_GI_IN_ROOM = RuleImage(roi_front=(92,17,213,64), roi_back=(92,17,213,64), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_in_room.png")
+	I_GI_IN_ROOM = RuleImage(roi_front=(92,17,213,64), roi_back=(92,17,213,64), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_gi_in_room.png")
+	# description 
+	I_BACK_YELLOW_SEA = RuleImage(roi_front=(31,16,42,42), roi_back=(31,16,42,42), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_back_yellow_sea.png")
 
 
 	# Image Rule Assets

+ 7 - 1
tasks/Component/GeneralInvite/general_invite.py

@@ -188,6 +188,9 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
             if not self.appear(self.I_GI_SURE) and self.appear_then_click(self.I_BACK_YELLOW, interval=0.8):
                 self.wait_until_appear(self.I_GI_SURE, wait_time=0.8)
                 continue
+            if not self.appear(self.I_GI_SURE) and self.appear_then_click(self.I_BACK_YELLOW_SEA, interval=0.8):
+                self.wait_until_appear(self.I_GI_SURE, wait_time=0.8)
+                continue
         return True
 
     def click_fire(self):
@@ -197,7 +200,8 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
                 break
             if self.appear_then_click(self.I_FIRE, interval=1, threshold=0.7):
                 continue
-
+            if self.appear_then_click(self.I_FIRE_SEA, interval=1, threshold=0.7):
+                continue
     @cached_property
     def room_type(self) -> RoomType:
         """
@@ -343,6 +347,8 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
                 continue
             if self.appear_then_click(self.I_ADD_5_4, interval=1):
                 continue
+            if self.appear_then_click(self.I_ADD_SEA, interval=1):
+                continue
 
         friend_class = []
         class_ocr = [self.O_F_LIST_1, self.O_F_LIST_2, self.O_F_LIST_3, self.O_F_LIST_4]

BIN
tasks/Component/GeneralInvite/gi/gi_back_yellow_sea.png


BIN
tasks/Component/GeneralInvite/gi/gi_fire_fail_sea.png


BIN
tasks/Component/GeneralInvite/gi/gi_fire_sea.png


BIN
tasks/Component/GeneralInvite/gi/gi_invite_ensure.png


+ 17 - 8
tasks/Component/GeneralInvite/gi/image.json

@@ -65,8 +65,8 @@
   {
     "itemName": "fire_fail_sea",
     "imageName": "gi_fire_fail_sea.png",
-    "roiFront": "1160,585,100,100",
-    "roiBack": "1160,585,100,100",
+    "roiFront": "1160,585,100,70",
+    "roiBack": "1160,585,100,70",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "永生之海挑战(还未有队友的图片)"
@@ -74,8 +74,8 @@
   {
     "itemName": "fire_sea",
     "imageName": "gi_fire_sea.png",
-    "roiFront": "1160,586,100,97",
-    "roiBack": "1160,586,100,97",
+    "roiFront": "1160,586,100,68",
+    "roiBack": "1160,586,100,68",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -155,8 +155,8 @@
   {
     "itemName": "invite_ensure",
     "imageName": "gi_invite_ensure.png",
-    "roiFront": "500,541,132,60",
-    "roiBack": "478,523,378,92",
+    "roiFront": "710,544,132,60",
+    "roiBack": "710,544,132,60",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击邀请"
@@ -165,7 +165,7 @@
     "itemName": "selected",
     "imageName": "gi_selected.png",
     "roiFront": "895,373,33,32",
-    "roiBack": "380,157,568,350",
+    "roiBack": "895,373,33,32",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "判断是否点中好友了"
@@ -352,11 +352,20 @@
   },
   {
     "itemName": "gi_in_room",
-    "imageName": "gi_in_room.png",
+    "imageName": "gi_gi_in_room.png",
     "roiFront": "92,17,213,64",
     "roiBack": "92,17,213,64",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "三人御魂组队左上角的协站队伍"
+  },
+  {
+    "itemName": "back_yellow_sea",
+    "imageName": "gi_back_yellow_sea.png",
+    "roiFront": "31,16,42,42",
+    "roiBack": "31,16,42,42",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
 ]

+ 1 - 1
tasks/Component/SwitchSoul/switch_soul.py

@@ -159,7 +159,7 @@ class SwitchSoul(BaseTask, SwitchSoulAssets):
             self.screenshot()
             if not self.appear(self.I_SOU_CHECK_IN):
                 break
-            if self.appear_then_click(self.I_RECORD_SOUL_BACK, interval=1):
+            if self.appear_then_click(self.I_RECORD_SOUL_BACK, interval=3.5):
                 continue
         logger.info('Exit shikigami records')
 

+ 1 - 0
tasks/Component/config_scheduler.py

@@ -16,6 +16,7 @@ class Scheduler(ConfigBase):
     success_interval: TimeDelta = Field(default=TimeDelta(days=1), description='success_interval_help')
     failure_interval: TimeDelta = Field(default=TimeDelta(days=1), description='failure_interval_help')
     server_update: Time = Field(default=Time(hour=9, minute=0, second=0), description='server_update_help')
+    delay_date: int = Field(default=1, description='delay_date_help', ge=1, le=31)
     float_time: Time = Field(default=Time(hour=0, minute=0, second=0), description='float_time_help')
 
     @validator('next_run', pre=True, always=True)

+ 17 - 3
tasks/EternitySea/assets.py

@@ -12,10 +12,24 @@ class EternitySeaAssets:
 
 	# Image Rule Assets
 	# 选择永生之海 
-	I_ETERNITY_SEA = RuleImage(roi_front=(1150,101,127,416), roi_back=(0,0,1279,719), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/es_eternity_sea.png")
+	I_ETERNITY_SEA = RuleImage(roi_front=(1139,93,127,416), roi_back=(1139,93,127,416), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_eternity_sea.png")
 	# 组队 
-	I_FORM_TEAM = RuleImage(roi_front=(939,594,96,90), roi_back=(939,594,96,90), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/es_form_team.png")
+	I_FORM_TEAM = RuleImage(roi_front=(939,594,96,90), roi_back=(939,594,96,90), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_form_team.png")
 	# 挑战 
-	I_ETERNITY_SEA_FIRE = RuleImage(roi_front=(1108,592,96,93), roi_back=(1108,592,96,93), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/es_eternity_sea_fire.png")
+	I_ETERNITY_SEA_FIRE = RuleImage(roi_front=(1108,592,96,93), roi_back=(1108,592,96,93), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_eternity_sea_fire.png")
+	# 开锁 
+	I_ETERNITYSEA_UNLOCK = RuleImage(roi_front=(556,560,35,34), roi_back=(556,560,35,34), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_eternitysea_unlock.png")
+	# 关锁 
+	I_NEWETERNITYSEA_LOCK = RuleImage(roi_front=(556,560,31,37), roi_back=(556,560,31,37), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_neweternitysea_lock.png")
+	# 小小宠物,发现宝藏 
+	I_PET_PRESENT = RuleImage(roi_front=(873,184,62,147), roi_back=(873,184,62,147), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_pet_present.png")
+	# description 
+	I_BACK_BOTTOM = RuleImage(roi_front=(1126,49,46,45), roi_back=(1126,49,46,45), threshold=0.8, method="Template matching", file="./tasks/EternitySea/res/res_back_bottom.png")
+
+
+	# List Rule Assets
+	# 永生之海层数列表 
+	L_LAYER_LIST = RuleList(folder="./tasks/EternitySea/res", direction="vertical", mode="ocr", roi_back=(138,127,353,435), size=(56, 68), 
+					 array=["壹", "贰", "叁", "肆"])
 
 

+ 3 - 1
tasks/EternitySea/config.py

@@ -6,6 +6,7 @@ from enum import Enum
 from datetime import datetime, time
 from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
+from tasks.Component.GeneralInvite.config_invite import InviteConfig
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase, Time
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
@@ -26,7 +27,7 @@ class EternitySeaConfig(ConfigBase):
     # 限制时间
     limit_time: Time = Field(default=Time(minute=30), description='limit_time_help')
     # 限制次数
-    limit_count: int = Field(default=50, description='limit_count_help')
+    limit_count: int = Field(default=30, description='limit_count_help')
 
 class EternitySea(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
@@ -34,4 +35,5 @@ class EternitySea(ConfigBase):
     general_battle_config: GeneralBattleConfig = Field(default_factory=GeneralBattleConfig)
     switch_soul_config_1: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
     switch_soul_config_2: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
+    invite_config: InviteConfig = Field(default_factory=InviteConfig)
 

BIN
tasks/EternitySea/res/es_eternity_sea.png


+ 63 - 27
tasks/EternitySea/res/image.json

@@ -1,29 +1,65 @@
 [
-    {
-        "itemName": "eternity_sea",
-        "imageName": "es_eternity_sea.png",
-        "roiFront": "1150,101,127,416",
-        "roiBack": "0,0,1279,719",
-        "method": "Template matching",
-        "threshold": 0.8,
-        "description": "选择永生之海"
-    },
-    {
-        "itemName": "form_team",
-        "imageName": "es_form_team.png",
-        "roiFront": "939,594,96,90",
-        "roiBack": "939,594,96,90",
-        "method": "Template matching",
-        "threshold": 0.8,
-        "description": "组队"
-    },
-    {
-        "itemName": "eternity_sea_fire",
-        "imageName": "es_eternity_sea_fire.png",
-        "roiFront": "1108,592,96,93",
-        "roiBack": "1108,592,96,93",
-        "method": "Template matching",
-        "threshold": 0.8,
-        "description": "挑战"
-    }
+  {
+    "itemName": "eternity_sea",
+    "imageName": "res_eternity_sea.png",
+    "roiFront": "1139,93,127,416",
+    "roiBack": "1139,93,127,416",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "选择永生之海"
+  },
+  {
+    "itemName": "form_team",
+    "imageName": "res_form_team.png",
+    "roiFront": "939,594,96,90",
+    "roiBack": "939,594,96,90",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "组队"
+  },
+  {
+    "itemName": "eternity_sea_fire",
+    "imageName": "res_eternity_sea_fire.png",
+    "roiFront": "1108,592,96,93",
+    "roiBack": "1108,592,96,93",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "挑战"
+  },
+  {
+    "itemName": "eternitysea_unlock",
+    "imageName": "res_eternitysea_unlock.png",
+    "roiFront": "556,560,35,34",
+    "roiBack": "556,560,35,34",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "开锁"
+  },
+  {
+    "itemName": "neweternitysea_lock",
+    "imageName": "res_neweternitysea_lock.png",
+    "roiFront": "556,560,31,37",
+    "roiBack": "556,560,31,37",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "关锁"
+  },
+  {
+    "itemName": "pet_present",
+    "imageName": "res_pet_present.png",
+    "roiFront": "873,184,62,147",
+    "roiBack": "873,184,62,147",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小小宠物,发现宝藏"
+  },
+  {
+    "itemName": "back_bottom",
+    "imageName": "res_back_bottom.png",
+    "roiFront": "1126,49,46,45",
+    "roiBack": "1126,49,46,45",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
 ]

+ 25 - 0
tasks/EternitySea/res/list.json

@@ -0,0 +1,25 @@
+{
+  "name": "layer_list",
+  "direction": "vertical",
+  "type": "ocr",
+  "roiBack": "138,127,353,435",
+  "description": "永生之海层数列表",
+  "list": [
+    {
+      "itemName": "壹",
+      "roiFront": "266,148,60,64"
+    },
+    {
+      "itemName": "贰",
+      "roiFront": "270,253,54,74"
+    },
+    {
+      "itemName": "叁",
+      "roiFront": "276,367,50,67"
+    },
+    {
+      "itemName": "肆",
+      "roiFront": "271,479,60,70"
+    }
+  ]
+}

BIN
tasks/EternitySea/res/res_back_bottom.png


BIN
tasks/EternitySea/res/res_eternity_sea.png


+ 0 - 0
tasks/EternitySea/res/es_eternity_sea_fire.png → tasks/EternitySea/res/res_eternity_sea_fire.png


BIN
tasks/EternitySea/res/res_eternitysea_unlock.png


+ 0 - 0
tasks/EternitySea/res/es_form_team.png → tasks/EternitySea/res/res_form_team.png


BIN
tasks/EternitySea/res/res_neweternitysea_lock.png


BIN
tasks/EternitySea/res/res_pet_present.png


+ 196 - 18
tasks/EternitySea/script_task.py

@@ -16,7 +16,8 @@ from tasks.EternitySea.assets import EternitySeaAssets
 from tasks.Orochi.config import UserStatus
 from tasks.EternitySea.config import EternitySea
 from module.exception import RequestHumanTakeover
-
+from tasks.GameUi.page import page_main, page_soul_zones, page_shikigami_records
+from time import sleep
 
 class ScriptTask(
     GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, EternitySeaAssets
@@ -40,13 +41,10 @@ class ScriptTask(
         self._two_teams_switch_sous(self._task_config.switch_soul_config_1)
         self._two_teams_switch_sous(self._task_config.switch_soul_config_2)
         match self._task_config.eternity_sea_config.user_status:
-            case UserStatus.ALONE:
-                success = self.run_alone()
-            case _:
-                logger.critical(
-                    f"UserStatus {self._task_config.eternity_sea_config.user_status} not support"
-                )
-                raise RequestHumanTakeover
+            case UserStatus.LEADER: success = self.run_leader()
+            case UserStatus.MEMBER: success = self.run_member()
+            case UserStatus.ALONE: self.run_alone()
+            case _: logger.error('Unknown user status')
 
         if success:
             self.set_next_run(self.task_name, finish=True, success=True)
@@ -55,6 +53,139 @@ class ScriptTask(
 
         raise TaskEnd(self.task_name)
 
+
+    def run_leader(self):
+        logger.info('Start run leader')
+        self._navigate_to_soul_zones()
+        self._enter_eternity_sea()
+        layer = self._task_config.eternity_sea_config.layer
+        self.check_layer(layer)
+        self.check_lock(self._task_config.general_battle_config.lock_team_enable)
+        # 创建队伍
+        logger.info('Create team')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CHECK_TEAM):
+                break
+            if self.appear_then_click(self.I_FORM_TEAM, interval=1):
+                continue
+        # 创建房间
+        self.create_room()
+        self.ensure_private()
+        self.create_ensure()
+
+        # 邀请队友
+        success = True
+        is_first = True
+        # 这个时候我已经进入房间了哦
+        while 1:
+            self.screenshot()
+            # 无论胜利与否, 都会出现是否邀请一次队友
+            # 区别在于,失败的话不会出现那个勾选默认邀请的框
+            if self.check_and_invite(self._task_config.invite_config.default_invite):
+                continue
+
+            #限制
+            if self.current_count >= self._task_config.eternity_sea_config.limit_count:
+                logger.info("EternitySea count limit out")
+                break
+            if datetime.now() - self.start_time >= self._limit_time:
+                logger.info("EternitySea time limit out")
+                break
+
+            # 如果没有进入房间那就不需要后面的邀请
+            if not self.is_in_room():
+                if self.is_room_dead():
+                    logger.warning('eternity_sea task failed')
+                    success = False
+                    break
+                continue
+
+            # 点击挑战
+            if not is_first:
+                if self.run_invite(config=self._task_config.invite_config):
+                    self.run_general_battle(config=self._task_config.general_battle_config)
+                else:
+                    # 邀请失败,退出任务
+                    logger.warning('Invite failed and exit this eternity_sea task')
+                    success = False
+                    break
+
+            # 第一次会邀请队友
+            if is_first:
+                if not self.run_invite(config=self._task_config.invite_config, is_first=True):
+                    logger.warning('Invite failed and exit this eternity_sea task')
+                    success = False
+                    break
+                else:
+                    is_first = False
+                    self.run_general_battle(config=self._task_config.general_battle_config)
+
+        # 当结束或者是失败退出循环的时候只有两个UI的可能,在房间或者是在组队界面
+        # 如果在房间就退出
+        if self.exit_room():
+            pass
+        # 如果在组队界面就退出
+        if self.exit_team():
+            pass
+
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+
+        if not success:
+            return False
+        return True
+
+
+    def run_member(self):
+        logger.info('Start run member')
+        self.ui_get_current_page()
+        # self.ui_goto(page_soul_zones)
+        # self.orochi_enter()
+        # self.check_lock(self.config.orochi.general_battle_config.lock_team_enable)
+
+        # 进入战斗流程
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        while 1:
+            self.screenshot()
+
+            #限制
+            if self.current_count >= self._task_config.eternity_sea_config.limit_count:
+                logger.info("EternitySea count limit out")
+                break
+            if datetime.now() - self.start_time >= self._limit_time:
+                logger.info("EternitySea time limit out")
+                break
+
+            if self.check_then_accept():
+                continue
+
+            if self.is_in_room():
+                self.device.stuck_record_clear()
+                if self.wait_battle(wait_time=self._task_config.invite_config.wait_time):
+                    self.run_general_battle(config=self._task_config.general_battle_config)
+                else:
+                    break
+            # 队长秒开的时候,检测是否进入到战斗中
+            elif self.check_take_over_battle(False, config=self._task_config.general_battle_config):
+                continue
+
+        while 1:
+            # 有一种情况是本来要退出的,但是队长邀请了进入的战斗的加载界面
+            if self.appear(self.I_GI_HOME) or self.appear(self.I_GI_EXPLORE):
+                break
+            # 如果可能在房间就退出
+            if self.exit_room():
+                pass
+            # 如果还在战斗中,就退出战斗
+            if self.exit_battle():
+                pass
+
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+        return True
+
+
     def run_alone(self) -> bool:
         logger.info("Start run alone")
         self._navigate_to_soul_zones()
@@ -89,6 +220,25 @@ class ScriptTask(
                     )
                     break
 
+    def is_room_dead(self) -> bool:
+        # 如果在探索界面或者是出现在组队界面,那就是可能房间死了
+        sleep(0.5)
+        if self.appear(self.I_MATCHING) or self.appear(self.I_CHECK_EXPLORATION):
+            sleep(0.5)
+            if self.appear(self.I_MATCHING) or self.appear(self.I_CHECK_EXPLORATION):
+                return True
+        return False
+
+    def eternitysea_enter(self) -> bool:
+        logger.info('Enter EternitySea')
+        while True:
+            self.screenshot()
+            if self.appear(self.I_FORM_TEAM):
+                return True
+            if self.appear_then_click(self.I_ETERNITY_SEA, interval=1):
+                continue
+
+
     def _is_in_eternity_sea(self) -> bool:
         self.screenshot()
         return self.appear(self.I_ETERNITY_SEA_FIRE)
@@ -104,13 +254,12 @@ class ScriptTask(
         logger.info("Enter eternity_sea")
         while True:
             self.screenshot()
-            if self.appear_then_click(self.I_ETERNITY_SEA, interval=1):
-                break
-
-        while True:
-            self.screenshot()
-            if self.appear(self.I_FORM_TEAM):
-                return
+            if self.appear(self.I_FORM_TEAM, interval=1):
+                return True
+            if self.appear_then_click(self.I_ETERNITY_SEA):
+                #有可能点击到录像
+                self.appear_then_click(self.I_BACK_BOTTOM, interval=1)
+                continue
 
     def _navigate_to_soul_zones(self) -> None:
         self.ui_get_current_page()
@@ -124,6 +273,37 @@ class ScriptTask(
     def _task_config(self) -> EternitySea:
         return self.config.model.eternity_sea
 
+    def check_layer(self, layer: str) -> bool:
+        """
+        检查挑战的层数, 并选中挑战的层
+        :return:
+        """
+        pos = self.list_find(self.L_LAYER_LIST, layer)
+        if pos:
+            self.device.click(x=pos[0], y=pos[1])
+            return True
+
+    def check_lock(self, lock: bool = True) -> bool:
+        """
+        检查是否锁定阵容, 要求在永生之海界面
+        :param lock:
+        :return:
+        """
+        logger.info('Check lock: %s', lock)
+        if lock:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_NEWETERNITYSEA_LOCK):
+                    return True
+                if self.appear_then_click(self.I_ETERNITYSEA_UNLOCK, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_ETERNITYSEA_UNLOCK):
+                    return True
+                if self.appear_then_click(self.I_NEWETERNITYSEA_LOCK, interval=1):
+                    continue
 
 if __name__ == "__main__":
     from module.config.config import Config
@@ -132,6 +312,4 @@ if __name__ == "__main__":
     c = Config("oas1")
     d = Device(c)
     t = ScriptTask(c, d)
-    t.screenshot()
-
-    t.run()
+    t.screenshot()

+ 10 - 1
tasks/Exploration/base.py

@@ -21,6 +21,7 @@ from tasks.RealmRaid.script_task import ScriptTask as RealmRaidScriptTask
 from tasks.Utils.config_enum import ShikigamiClass
 
 from module.logger import logger
+from module.base.timer import Timer
 from module.exception import RequestHumanTakeover, TaskEnd
 from module.atom.image_grid import ImageGrid
 from module.atom.animate import RuleAnimate
@@ -338,13 +339,21 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
 
     def quit_explore(self):
         logger.info('Quit explore')
+        boss_timer = Timer(15)
+        boss_timer.start()
         while 1:
             self.screenshot()
             if self.appear(self.I_UI_BACK_RED) and self.appear(self.I_E_EXPLORATION_CLICK):
                 break
+            if boss_timer.reached():
+                # https://github.com/runhey/OnmyojiAutoScript/issues/548
+                logger.warning('Exit immediately after the boss battle')
+                break
             if self.appear_then_click(self.I_E_EXIT_CONFIRM, interval=0.8):
                 continue
-            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1.5):
+            if self.appear(self.I_EXPLORATION_TITLE) or self.appear(self.I_CHECK_EXPLORATION):
+                continue
+            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=3.5):
                 continue
 
     def fire(self, button) -> bool:

+ 33 - 26
tasks/GoldYoukai/script_task.py

@@ -44,32 +44,38 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
             if con.buff_gold_100_click:
                 self.gold_100()
             self.close_buff()
-        self.ui_get_current_page()
-        self.ui_goto(page_team)
-        self.check_zones('金币妖怪')
-        # 开始
-        if not self.create_room():
-            self.gold_exit(con)
-        self.ensure_public()
-        self.create_ensure()
-        # 进入到了房间里面
-        wait_timer = Timer(60)
-        wait_timer.start()
-        while 1:
-            self.screenshot()
-
-            if not self.is_in_room():
-                continue
-            if wait_timer.reached():
-                logger.warning('Wait for too long, exit')
-                self.exit_room()
-                break
-            if not self.appear(self.I_ADD_5_1):
-                # 有人进来了,可以进行挑战
-                logger.info('There is someone in the room and start the challenge')
-                self.click_fire()
-                self.run_general_battle()
-                break
+        count = 0
+        while count < 2:
+            self.ui_get_current_page()
+            self.ui_goto(page_team)
+            self.check_zones('金币妖怪')
+            # 开始
+            if not self.create_room():
+                self.gold_exit(con)
+            self.ensure_public()
+            self.create_ensure()
+            # 进入到了房间里面
+            wait_timer = Timer(50)
+            wait_timer.start()
+            while 1:
+                self.screenshot()
+
+                if not self.is_in_room():
+                    continue
+                if wait_timer.reached():
+                    # 超过时间依然挑战
+                    logger.warning('Wait for too long and start the challenge')
+                    self.click_fire()
+                    count += 1
+                    self.run_general_battle()
+                    break
+                if not self.appear(self.I_ADD_5_1):
+                    # 有人进来了,可以进行挑战
+                    logger.info('There is someone in the room and start the challenge')
+                    self.click_fire()
+                    count += 1
+                    self.run_general_battle()
+                    break
         # 退出 (要么是在组队界面要么是在庭院)
         self.gold_exit(con)
 
@@ -114,6 +120,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
+
     c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)

BIN
tasks/HeroTest/as/as_start_challenge.png


+ 9 - 0
tasks/HeroTest/as/image.json

@@ -187,5 +187,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "通过兵藏秘境取消重置按钮"
+  },
+  {
+    "itemName": "start_challenge",
+    "imageName": "as_start_challenge.png",
+    "roiFront": "685,407,142,47",
+    "roiBack": "685,407,142,47",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "周一点击确认开始挑战"
   }
 ]

+ 2 - 0
tasks/HeroTest/assets.py

@@ -53,6 +53,8 @@ class HeroTestAssets:
 	I_BCMJ_RESET_CONFIRM = RuleImage(roi_front=(668,399,180,70), roi_back=(668,399,180,70), threshold=0.8, method="Template matching", file="./tasks/HeroTest/as/as_bcmj_reset_confirm.png")
 	# 通过兵藏秘境取消重置按钮 
 	I_BCMJ_RESET_CLOSE = RuleImage(roi_front=(429,397,186,71), roi_back=(429,397,186,71), threshold=0.8, method="Template matching", file="./tasks/HeroTest/as/as_bcmj_reset_close.png")
+	# 周一点击确认开始挑战 
+	I_START_CHALLENGE = RuleImage(roi_front=(685,407,142,47), roi_back=(685,407,142,47), threshold=0.8, method="Template matching", file="./tasks/HeroTest/as/as_start_challenge.png")
 
 
 	# Ocr Rule Assets

+ 25 - 18
tasks/HeroTest/script_task.py

@@ -8,6 +8,7 @@ from tasks.Component.BaseActivity.base_activity import BaseActivity
 from tasks.HeroTest.assets import HeroTestAssets
 from tasks.GameUi.page import page_main, page_shikigami_records
 from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_exploration
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 
 from module.logger import logger
@@ -52,6 +53,13 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
 
         self.ui_get_current_page()
         self.ui_goto(page_main)
+        # 启动经验加成
+        if is_update:
+            self.open_buff()
+            self.exp_100(True)
+            self.exp_50(True)
+            self.close_buff()
+        self.ui_goto(page_exploration)
         self.home_main()
         # 设定是否锁定阵容
         if is_update:
@@ -109,7 +117,7 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
             # 如果是兵藏秘境 看看是否有兵道帖
             if is_skill:
                 if not self.check_art_war_card():
-                    logger.info("Art war card is enough")
+                    logger.info("Art war card is not enough")
                     break
             # 点击战斗
             logger.info("Click battle")
@@ -122,6 +130,11 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
                     if not self.appear(self.I_BATTLE):
                         break
                 elif is_skill:
+                    if not self.check_art_war_card():
+                        logger.info("Art war card is not nough")
+                        break
+                    if self.appear_then_click(self.I_START_CHALLENGE, interval=1):
+                        continue
                     if self.appear_then_click(self.I_BCMJ_RESET_CONFIRM, interval=1):
                         continue
                     if self.appear_then_click(self.I_BCMJ_BATTLE, interval=2):
@@ -258,12 +271,6 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
         logger.hr("Enter HeroTest", 2)
         global is_update
         global is_skill
-        # 启动经验加成
-        if is_update:
-            self.open_buff()
-            self.exp_100(True)
-            self.exp_50(True)
-            self.close_buff()
         while 1:
             self.screenshot()
             if is_update:
@@ -272,8 +279,6 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
             if is_skill:
                 if self.appear(self.I_BCMJ_BATTLE):
                     break
-            if self.appear_then_click(self.I_ONE, interval=1):
-                continue
             if self.appear_then_click(self.I_TWO, interval=1):
                 continue
             if is_update:
@@ -292,14 +297,6 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
         global is_update
         while 1:
             self.screenshot()
-            if self.appear(self.I_ONE):
-                if is_update:
-                    # 关闭经验加成
-                    self.open_buff()
-                    self.exp_100(False)
-                    self.exp_50(False)
-                    self.close_buff()
-                break
             if self.appear_then_click(self.I_UI_BACK_RED, interval=2):
                 continue
             if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=2):
@@ -308,13 +305,23 @@ class ScriptTask(GameUi, BaseActivity, HeroTestAssets, SwitchSoul):
                 continue
             if self.appear_then_click(self.I_GBB_BACK, interval=2):
                 continue
+            self.ui_get_current_page()
+            self.ui_goto(page_main)
+            if is_update:
+                # 关闭经验加成
+                self.open_buff()
+                self.exp_100(False)
+                self.exp_50(False)
+                self.close_buff()
+            break
+
 
 
 if __name__ == "__main__":
     from module.config.config import Config
     from module.device.device import Device
 
-    c = Config("oas1")
+    c = Config("oas2")
     d = Device(c)
     t = ScriptTask(c, d)
 

+ 2 - 2
tasks/Orochi/config.py

@@ -50,9 +50,9 @@ class SwitchSoulConfig(BaseSwitchSoulConfig):
     enable_switch_by_name: bool = Field(default=False, description='enable_switch_by_name_help')
     group_name: str = Field(default='')
     team_name: str = Field(default='')
-    auto_switch_soul: bool = Field(default=False, description='auto_switch_soul_help')
+    auto_switch_soul: bool = Field(default=False, description='auto_switch_soul_orochi_help')
     # 十层 config
-    # ten_switch: str = Field(default='-1,-1', description='ten_switch_help')
+    ten_switch: str = Field(default='-1,-1', description='ten_switch_help')
     # 悲鸣 config
     eleven_switch: str = Field(default='-1,-1', description='eleven_switch_help')
     # 神罚 config

+ 2 - 2
tasks/Orochi/script_task.py

@@ -482,8 +482,8 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         group_team: str = None
         layer = self.config.orochi.orochi_config.layer
         match layer:
-            # case Layer.TEN:
-            #     group_team = orochi_switch_soul.ten_switch
+            case Layer.TEN:
+                group_team = orochi_switch_soul.ten_switch
             case Layer.ELEVEN:
                 group_team = orochi_switch_soul.eleven_switch
             case Layer.TWELVE:

+ 1 - 1
tasks/base_task.py

@@ -117,7 +117,7 @@ class BaseTask(GlobalGameAssets, CostumeBase):
         self.device.detect_record = detect_record
         # 如果接受邀请则立即执行悬赏任务
         if click_button == self.I_G_ACCEPT:
-            self.set_next_run(task='WantedQuests', target=datetime.now())
+            self.set_next_run(task='WantedQuests', target=datetime.now().replace(microsecond=0))
         return True
 
     def screenshot(self):