Преглед изворни кода

fix(Restart): #585 Deal with game login abnormal ui

ryland пре 1 година
родитељ
комит
5865a97089

+ 1 - 1
tasks/GameUi/assets.py

@@ -170,7 +170,7 @@ class GameUiAssets:
 	I_BACK_DAILY = RuleImage(roi_front=(33,13,39,50), roi_back=(33,13,39,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_daily.png")
 	# description 
 	I_NEW = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/image_name.png")
-	# 下载拓展包弹窗
+	# 下载拓展包弹窗 
 	I_DLC_CLOSE = RuleImage(roi_front=(916,147,24,25), roi_back=(916,147,24,25), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/store_dlc_close.png")
 
 

+ 6 - 2
tasks/Restart/assets.py

@@ -1,7 +1,9 @@
-from module.atom.click import RuleClick
 from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
 from module.atom.ocr import RuleOcr
-
+from module.atom.list import RuleList
 
 # This file was automatically generated by ./dev_tools/assets_extract.py.
 # Don't modify it manually.
@@ -83,6 +85,8 @@ class RestartAssets:
 	I_LOGIN_LOGIN_CANCEL_BIND_PHONE = RuleImage(roi_front=(450,460,160,100), roi_back=(450,460,160,100), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_login_cancel_bind_phone.png")
 	# 登录界面 弹出框 阴阳师精灵 
 	I_LOGIN_LOGIN_ONMYOJI_GENIE = RuleImage(roi_front=(80,110,280,120), roi_back=(80,110,280,120), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_login_onmyoji_genie.png")
+	# 已有角色 
+	I_CHARACTARS = RuleImage(roi_front=(246,535,100,31), roi_back=(219,523,173,57), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_charactars.png")
 
 
 	# Ocr Rule Assets

+ 3 - 0
tasks/Restart/login.py

@@ -109,6 +109,9 @@ class LoginHandler(BaseTask, RestartAssets):
             # 点击’进入游戏‘
             if not self.appear(self.I_LOGIN_8):
                 continue
+            if self.appear(self.I_CHARACTARS, interval=1):
+                # https://github.com/runhey/OnmyojiAutoScript/issues/585
+                self.device.click(x=246, y=535)
             if self.ocr_appear_click(self.O_LOGIN_ENTER_GAME, interval=3):
                 self.wait_until_appear(self.I_LOGIN_SPECIFIC_SERVE, True, wait_time=5)
                 continue

+ 9 - 0
tasks/Restart/login/image.json

@@ -106,5 +106,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "登录界面 弹出框 阴阳师精灵"
+  },
+  {
+    "itemName": "charactars",
+    "imageName": "login_charactars.png",
+    "roiFront": "246,535,100,31",
+    "roiBack": "219,523,173,57",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "已有角色"
   }
 ]

BIN
tasks/Restart/login/login_charactars.png


+ 1 - 1
tasks/WantedQuests/assets.py

@@ -86,7 +86,7 @@ class WantedQuestsAssets:
 	I_WQ_INVITE_CANCEL = RuleImage(roi_front=(230,540,132,60), roi_back=(230,540,140,65), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_invite_cancel.png")
 	# 邀请好友被选中标记 
 	I_WQ_INVITE_SELECTED = RuleImage(roi_front=(370,180,32,32), roi_back=(370,180,370,355), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_invite_selected.png")
-	# 邀请好友被选中标记 
+	# 好友列表已加载标志 
 	I_WQ_INVITE_FRIEND_LIST_APPEAR = RuleImage(roi_front=(370,180,32,32), roi_back=(370,180,370,355), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_invite_friend_list_appear.png")
 	# 邀请同服好友,由于选中与未选中亮度有区别,查找图片可能会出错,建议只使用位置信息 
 	I_WQ_INVITE_SAME_SVR = RuleImage(roi_front=(170,90,60,35), roi_back=(170,90,105,65), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_invite_same_svr.png")