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

Merge branch 'runhey:dev' into dev

migsmiku 1 год назад
Родитель
Сommit
0b682b8490

+ 4 - 3
module/config/config_manual.py

@@ -15,10 +15,11 @@ class ConfigManual:
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > ActivityShikigami > WantedQuests
         > BondlingFairyland > EvoZone > GoryouRealm > HeroTest
-        > TrueOrochi > RichMan
-        > CollectiveMissions
+        > CollectiveMissionsr
         > Pets > TalismanPass > Delegation > Hyakkiyakou
-        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials
+        > Secret > WeeklyTrifles > MysteryShop > Duel 
+        > TrueOrochi > RichMan
+        > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials
         """
 
     DEVICE_OVER_HTTP = False

+ 1 - 1
tasks/ActivityShikigami/script_task.py

@@ -106,7 +106,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
 
             # 随机休息
             if config.general_climb.random_sleep:
-                random_sleep()
+                random_sleep(probability=0.2)
             # 点击战斗
             logger.info("Click battle")
             while 1:

+ 1 - 1
tasks/CollectiveMissions/assets.py

@@ -27,7 +27,7 @@ class CollectiveMissionsAssets:
 	# 提交 
 	I_CM_PRESENT = RuleImage(roi_front=(559,594,160,66), roi_back=(559,594,160,66), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_present.png")
 	# 判断是否到达 
-	I_CM_RECORDS = RuleImage(roi_front=(1105,626,54,63), roi_back=(1105,626,54,63), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_records.png")
+	I_CM_RECORDS = RuleImage(roi_front=(1032,617,54,63), roi_back=(960,562,193,138), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_records.png")
 	# 将材料拉满的按钮,用来判断是否拉满 
 	I_CM_MATTER = RuleImage(roi_front=(860,396,36,37), roi_back=(843,119,66,459), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_matter.png")
 	# description 

+ 2 - 2
tasks/CollectiveMissions/cm/image.json

@@ -29,8 +29,8 @@
   {
     "itemName": "cm_records",
     "imageName": "cm_cm_records.png",
-    "roiFront": "1105,626,54,63",
-    "roiBack": "1105,626,54,63",
+    "roiFront": "1032,617,54,63",
+    "roiBack": "960,562,193,138",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "判断是否到达"

+ 11 - 1
tasks/Component/GeneralBattle/assets.py

@@ -108,7 +108,17 @@ class GeneralBattleAssets:
 	# 结算时左下角统计图标 
 	I_REWARD_STATISTICS = RuleImage(roi_front=(51,629,54,59), roi_back=(51,629,54,59), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_statistics.png")
 	# 结算金币 
-	I_REWARD_GOLD = RuleImage(roi_front=(943,312,97,69), roi_back=(943,312,97,69), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	I_REWARD_GOLD = RuleImage(roi_front=(268,178,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	# 结算紫蛇皮 
+	I_REWARD_PURPLE_SNAKE_SKIN = RuleImage(roi_front=(403,177,97,73), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png")
+	# 结算金蛇皮 
+	I_REWARD_GOLD_SNAKE_SKIN = RuleImage(roi_front=(537,176,97,75), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png")
+	# 结算四星青吉鬼 
+	I_REWARD_EXP_SOUL_4 = RuleImage(roi_front=(806,177,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png")
+	# 结算五星御魂 
+	I_REWARD_SOUL_5 = RuleImage(roi_front=(266,533,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png")
+	# 结算六星御魂 
+	I_REWARD_SOUL_6 = RuleImage(roi_front=(942,397,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png")
 	# 针对封魔的特殊 
 	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	# description 

BIN
tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png


+ 47 - 2
tasks/Component/GeneralBattle/gb/image.json

@@ -182,12 +182,57 @@
   {
     "itemName": "reward_gold",
     "imageName": "gb_reward_gold.png",
-    "roiFront": "943,312,97,69",
-    "roiBack": "943,312,97,69",
+    "roiFront": "268,178,97,69",
+    "roiBack": "254,163,797,261",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "结算金币"
   },
+  {
+    "itemName": "reward_purple_snake_skin",
+    "imageName": "gb_reward_purple_snake_skin.png",
+    "roiFront": "403,177,97,73",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算紫蛇皮"
+  },
+  {
+    "itemName": "reward_gold_snake_skin",
+    "imageName": "gb_reward_gold_snake_skin.png",
+    "roiFront": "537,176,97,75",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算金蛇皮"
+  },
+  {
+    "itemName": "reward_exp_soul_4",
+    "imageName": "gb_reward_exp_soul_4.png",
+    "roiFront": "806,177,97,69",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算四星青吉鬼"
+  },
+  {
+    "itemName": "reward_soul_5",
+    "imageName": "gb_reward_soul_5.png",
+    "roiFront": "266,533,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算五星御魂"
+  },
+  {
+    "itemName": "reward_soul_6",
+    "imageName": "gb_reward_soul_6.png",
+    "roiFront": "942,397,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算六星御魂"
+  },
   {
     "itemName": "de_win",
     "imageName": "gb_de_win.png",

+ 18 - 3
tasks/Component/GeneralBattle/general_battle.py

@@ -223,10 +223,25 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             self.screenshot()
             # 如果出现领奖励
             action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
-            if self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or \
-                    self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5):
+            if (self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or
+                self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5)#  or
+                # self.appear_then_click(self.I_REWARD_STATISTICS, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_PURPLE_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_GOLD_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_EXP_SOUL_4, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_5, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_6, action=action_click, interval=1.5)
+                ):
                 continue
-            if not self.appear(self.I_REWARD) and not self.appear(self.I_REWARD_GOLD):
+            if (not self.appear(self.I_REWARD) and
+                not self.appear(self.I_REWARD_GOLD)#  and
+                # not self.appear(self.I_REWARD_STATISTICS) and
+                # not self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_GOLD_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_EXP_SOUL_4) and
+                # not self.appear(self.I_REWARD_SOUL_5) and
+                # not self.appear(self.I_REWARD_SOUL_6)
+                ):
                 break
 
         return win

+ 6 - 5
tasks/ExperienceYoukai/assets.py

@@ -7,10 +7,11 @@ from module.atom.list import RuleList
 
 # This file was automatically generated by ./dev_tools/assets_extract.py.
 # Don't modify it manually.
-class ExperienceYoukaiAssets:
+class ExperienceYoukaiAssets: 
+
+
+	# Image Rule Assets
+	# 经验妖怪的赢 
+	I_EXP_WIN = RuleImage(roi_front=(380,44,100,100), roi_back=(380,44,100,100), threshold=0.8, method="Template matching", file="./tasks/ExperienceYoukai/ey/ey_exp_win.png")
 
 
-    # Image Rule Assets
-    # 经验妖怪的赢
-	I_EXP_WIN = RuleImage(roi_front=(380, 44, 100, 100), roi_back=(380, 44, 100, 100), threshold=0.8,
-					   method="Template matching", file="./tasks/ExperienceYoukai/ey/ey_exp_win.png")

+ 3 - 0
tasks/Hyakkiyakou/slave/hya_device.py

@@ -1,5 +1,6 @@
 import timeit
 import numpy as np
+from datetime import datetime
 
 from module.base.timer import Timer
 from module.logger import logger
@@ -38,6 +39,8 @@ class HyaDevice(BaseTask):
             logger.error('Fast screenshot check timer reached')
             logger.error('Five minutes have not ended, the game is probably stuck, please check the game')
             raise GameStuckError
+        if self.config.script.error.save_error:
+            self.device.screenshot_deque.append({'time': datetime.now(), 'image': self.device.image})
         return self.device.image
 
     def fast_click(self, x: int, y: int, control_method: ControlMethod = ControlMethod.WINDOW_MESSAGE) -> None:

+ 1 - 1
tasks/MemoryScrolls/config.py

@@ -19,7 +19,7 @@ class ScrollNumber(str, Enum):
 
 class MemoryScrollsConfig(ConfigBase):
     scroll_number: ScrollNumber = Field(default=ScrollNumber.ONE, description='scroll_number_help')
-    auto_delay_exploration: bool = Field(default=True, description='指定绘卷结束后,自动延迟探索任务,避免长时间无意义执行')
+    auto_close_exploration: bool = Field(default=False, description='指定绘卷结束后,自动关闭探索任务,避免长时间无意义执行')
 
 class MemoryScrolls(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 7 - 5
tasks/MemoryScrolls/script_task.py

@@ -82,11 +82,13 @@ class ScriptTask(GameUi, MemoryScrollsAssets):
         else:
             logger.info(f'Scroll {con.scroll_number.name} is already completed')
             self.set_next_run(task='MemoryScrolls', success=False)
-            if con.auto_delay_exploration:
-                # 自动延迟探索任务
-                logger.info('Auto delay exploration task after Memory Scrolls completion')
-                next_run=datetime.now() + timedelta(days=1)
-                self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
+            if con.auto_close_exploration:
+                # 自动关闭探索任务
+                logger.info('Auto close exploration task after Memory Scrolls completion')
+                self.config.exploration.scheduler.enable = False
+                self.config.save()
+                # next_run=datetime.now() + timedelta(days=1)
+                # self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
         # 返回绘卷主界面
         self.ui_click_until_disappear(self.I_MS_CLOSE, interval=1)
         logger.info('Closed Memory Scrolls contribution page')