Răsfoiți Sursa

fix花合战收获御魂

yEs1do 1 an în urmă
părinte
comite
8dfe2585f3

+ 2 - 2
tasks/Restart/assets.py

@@ -41,9 +41,9 @@ class RestartAssets:
 	I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
 	# 点击随机御魂 
 	I_HARVEST_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_1.png")
-	# 选择第一个御魂 
+	# 选择中间第二个御魂 
 	I_HARVEST_SOUL_2 = RuleImage(roi_front=(586,561,112,47), roi_back=(570,547,139,71), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_2.png")
-	# description 
+	# 六星御魂标志 
 	I_HARVEST_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_3.png")
 	# 寮包 
 	I_HARVEST_GUILD_REWARD = RuleImage(roi_front=(244,498,41,42), roi_back=(200,403,817,157), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_guild_reward.png")

+ 2 - 2
tasks/Restart/harvest/image.json

@@ -141,7 +141,7 @@
     "roiBack": "570,547,139,71",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "选择第一个御魂"
+    "description": "选择中间第二个御魂"
   },
   {
     "itemName": "harvest_soul_3",
@@ -150,7 +150,7 @@
     "roiBack": "302,472,216,60",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "六星御魂标志"
   },
   {
     "itemName": "harvest_guild_reward",

+ 1 - 1
tasks/Restart/login.py

@@ -273,7 +273,7 @@ class LoginHandler(BaseTask, RestartAssets):
                 continue
             # 自选御魂
             if self.appear(self.I_HARVEST_SOUL_1):
-                logger.info('Select soul 1')
+                logger.info('Select soul 2')
                 self.ui_click(self.I_HARVEST_SOUL_1, stop=self.I_HARVEST_SOUL_2)
                 self.ui_click(self.I_HARVEST_SOUL_2, stop=self.I_HARVEST_SOUL_3, interval=3)
                 self.ui_click_until_disappear(click=self.I_HARVEST_SOUL_3)

+ 6 - 0
tasks/TalismanPass/assets.py

@@ -33,5 +33,11 @@ class TalismanPassAssets:
 	I_TP_EXP = RuleImage(roi_front=(922,254,32,36), roi_back=(884,215,100,331), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_exp.png")
 	# 溢出确认 
 	I_OVERFLOW_CONFIRME = RuleImage(roi_front=(585,410,116,44), roi_back=(585,410,116,44), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_overflow_confirme.png")
+	# 点击随机御魂 
+	I_TP_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_1.png")
+	# 选择中间第二个御魂 
+	I_TP_SOUL_2 = RuleImage(roi_front=(582,438,115,48), roi_back=(570,427,139,71), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_2.png")
+	# 六星御魂标志 
+	I_TP_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_3.png")
 
 

+ 6 - 15
tasks/TalismanPass/script_task.py

@@ -5,7 +5,6 @@ import time
 
 from tasks.GameUi.game_ui import GameUi
 from tasks.GameUi.page import page_main, page_daily
-from tasks.Restart.assets import RestartAssets
 from tasks.TalismanPass.assets import TalismanPassAssets
 from tasks.TalismanPass.config import TalismanConfig, LevelReward
 
@@ -13,7 +12,7 @@ from module.logger import logger
 from module.exception import TaskEnd
 from module.base.timer import Timer
 
-class ScriptTask(GameUi, TalismanPassAssets, RestartAssets):
+class ScriptTask(GameUi, TalismanPassAssets):
 
     def run(self):
         self.ui_get_current_page()
@@ -105,20 +104,12 @@ class ScriptTask(GameUi, TalismanPassAssets, RestartAssets):
         timer_harvest = Timer(5)  # 如果连续5秒没有发现任何奖励,退出
         while 1:
             self.screenshot()
-            # 点击'获得奖励'
-            if self.ui_reward_appear_click():
-                timer_harvest.reset()
-                continue
-            # 获得奖励
-            if self.appear_then_click(self.I_UI_AWARD, interval=0.2):
-                timer_harvest.reset()
-                continue            
             # 自选御魂
-            if self.appear(self.I_HARVEST_SOUL_1):
-                logger.info('Select soul 1')
-                self.ui_click(self.I_HARVEST_SOUL_1, stop=self.I_HARVEST_SOUL_2)
-                self.ui_click(self.I_HARVEST_SOUL_2, stop=self.I_HARVEST_SOUL_3, interval=3)
-                self.ui_click_until_disappear(click=self.I_HARVEST_SOUL_3)
+            if self.appear(self.I_TP_SOUL_1):
+                logger.info('Select soul 2')
+                self.ui_click(self.I_TP_SOUL_1, stop=self.I_TP_SOUL_2)
+                self.ui_click(self.I_TP_SOUL_2, stop=self.I_TP_SOUL_3, interval=3)
+                self.ui_click_until_disappear(click=self.I_TP_SOUL_3)
                 timer_harvest.reset()
             # 五秒内没有发现任何奖励,退出
             if not timer_harvest.started():

+ 27 - 0
tasks/TalismanPass/tp/image.json

@@ -97,5 +97,32 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "溢出确认"
+  },
+  {
+    "itemName": "tp_soul_1",
+    "imageName": "tp_tp_soul_1.png",
+    "roiFront": "248,501,34,37",
+    "roiBack": "165,389,929,168",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击随机御魂"
+  },
+  {
+    "itemName": "tp_soul_2",
+    "imageName": "tp_tp_soul_2.png",
+    "roiFront": "582,438,115,48",
+    "roiBack": "570,427,139,71",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "选择中间第二个御魂"
+  },
+  {
+    "itemName": "tp_soul_3",
+    "imageName": "tp_tp_soul_3.png",
+    "roiFront": "313,489,188,33",
+    "roiBack": "302,472,216,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "六星御魂标志"
   }
 ]

BIN
tasks/TalismanPass/tp/tp_tp_soul_1.png


BIN
tasks/TalismanPass/tp/tp_tp_soul_2.png


BIN
tasks/TalismanPass/tp/tp_tp_soul_3.png