runhey 3 лет назад
Родитель
Сommit
b05e1875bf

+ 1 - 1
tasks/Component/Buy/buy.py

@@ -135,7 +135,7 @@ class Buy(BaseTask, BuyAssets):
                 while 1:
                     self.screenshot()
                     # 等待动画结束
-                    if not self.appear(self.I_UI_REWARD):
+                    if not self.appear(self.I_UI_REWARD, threshold=0.6):
                         logger.info('Get reward success')
                         break
                     # 一直点击

+ 2 - 0
tasks/Component/SwitchSoul/assets.py

@@ -25,6 +25,8 @@ class SwitchSoulAssets:
 	C_SOU_GROUP_6 = RuleClick(roi_front=(1088,437,156,57), roi_back=(1088,437,156,57), name="sou_group_6")
 	# description 
 	C_SOU_GROUP_7 = RuleClick(roi_front=(1090,505,156,62), roi_back=(1090,505,156,62), name="sou_group_7")
+	# 阵容选择按钮位置 
+	C_SOU_TEAM_SELECT = RuleClick(roi_front=(977,157,21,21), roi_back=(977,157,21,21), name="sou_team_select")
 
 
 	# Image Rule Assets

+ 4 - 4
tasks/GameUi/game_ui.py

@@ -29,11 +29,11 @@ class GameUi(BaseTask, GameUiAssets):
                 page_shikigami_records, page_onmyodo, page_friends, page_daily, page_mall, page_guild, page_team,
                 page_collection
                 ]
-    ui_close = [GameUiAssets.I_BACK_BLUE, GameUiAssets.I_BACK_Y, GameUiAssets.I_BACK_MALL,
+    ui_close = [GameUiAssets.I_BACK_MALL,
+                BaseTask.I_UI_BACK_RED, BaseTask.I_UI_BACK_YELLOW, BaseTask.I_UI_BACK_BLUE,
                 GameUiAssets.I_BACK_FRIENDS, GameUiAssets.I_BACK_DAILY,
-                GameUiAssets.I_BONDLING_GOTO_EXPLORATION, GameUiAssets.I_REALM_RAID_GOTO_EXPLORATION,
-                GameUiAssets.I_SIX_GATES_GOTO_EXPLORATION, GameUiAssets.I_SUMMON_GOTO_MAIN
-                ]
+                GameUiAssets.I_REALM_RAID_GOTO_EXPLORATION,
+                GameUiAssets.I_SIX_GATES_GOTO_EXPLORATION]
 
     def home_explore(self) -> bool:
         """

+ 1 - 1
tasks/RichMan/assets.py

@@ -160,7 +160,7 @@ class RichManAssets:
 	# 契灵商店 
 	I_MALL_BONDLINGS_SURE = RuleImage(roi_front=(1194,421,69,74), roi_back=(1194,421,69,74), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/navbar/navbar_mall_bondlings_sure.png")
 	# 契灵商店 
-	I_MALL_BONDLINGS_CHECK = RuleImage(roi_front=(646,421,191,37), roi_back=(646,421,191,37), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/navbar/navbar_mall_bondlings_check.png")
+	I_MALL_BONDLINGS_CHECK = RuleImage(roi_front=(355,186,34,104), roi_back=(355,186,34,104), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/navbar/navbar_mall_bondlings_check.png")
 	# 杂货铺 
 	I_MALL_SUNDRY = RuleImage(roi_front=(854,623,74,61), roi_back=(854,623,74,61), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/navbar/navbar_mall_sundry.png")
 	# 杂货铺 

+ 1 - 1
tasks/RichMan/guild.py

@@ -11,7 +11,7 @@ from tasks.Component.Buy.buy import Buy
 from tasks.RichMan.assets import RichManAssets
 from tasks.RichMan.config import GuildStore
 
-class Guild(GameUi, Buy, RichManAssets):
+class Guild(Buy, GameUi, RichManAssets):
 
     def execute_guild(self, con: GuildStore=None):
         logger.hr('Start guild', 1)

+ 1 - 1
tasks/RichMan/mall/bondlings.py

@@ -14,7 +14,7 @@ from tasks.RichMan.assets import RichManAssets
 from tasks.RichMan.config import Bondlings as BondlingsConfig
 
 
-class Bondlings(MallNavbar, Buy):
+class Bondlings(Buy, MallNavbar):
 
     def execute_bondlings(self, con: BondlingsConfig = None):
         if not con:

+ 1 - 1
tasks/RichMan/mall/consignment.py

@@ -11,7 +11,7 @@ from tasks.RichMan.mall.navbar import MallNavbar
 from tasks.RichMan.config import Consignment as ConsignmentStore
 
 
-class Consignment(MallNavbar, Buy):
+class Consignment(Buy, MallNavbar):
 
     def execute_consignment(self, con: ConsignmentStore=None):
         """

+ 4 - 3
tasks/RichMan/mall/mall.py

@@ -4,22 +4,22 @@
 from module.logger import logger
 
 from tasks.RichMan.mall.special import Special
-from tasks.RichMan.mall.honor import Honor
 from tasks.RichMan.mall.friendship_points import FriendshipPoints
 from tasks.RichMan.mall.medal import Medal
 from tasks.RichMan.mall.charisma import Charisma
 from tasks.RichMan.mall.consignment import Consignment
 from tasks.RichMan.mall.scales import Scales
+from tasks.RichMan.mall.honor import Honor
 from tasks.RichMan.mall.bondlings import Bondlings
 from tasks.GameUi.page import page_main, page_mall
 
-class Mall(Special, Honor, FriendshipPoints, Medal, Charisma, Consignment, Scales, Bondlings):
+class Mall(Medal, Charisma, Honor, Consignment, Scales, Bondlings):
 
 
     def execute_mall(self):
         logger.hr('Mall', 1)
         self.ui_get_current_page()
-        self.ui_goto(page_mall, confirm_wait=4)
+        self.ui_goto(page_mall, confirm_wait=2.5)
 
         # 寄售屋
         self.execute_consignment()
@@ -29,6 +29,7 @@ class Mall(Special, Honor, FriendshipPoints, Medal, Charisma, Consignment, Scale
         self.execute_bondlings()
 
         # 杂货铺
+        self.execute_special()
         self.execute_honor()
         self.execute_friendship()
         self.execute_medal()

+ 2 - 2
tasks/RichMan/mall/navbar/image_bottom.json

@@ -56,8 +56,8 @@
   {
     "itemName": "mall_bondlings_check",
     "imageName": "navbar_mall_bondlings_check.png",
-    "roiFront": "646,421,191,37",
-    "roiBack": "646,421,191,37",
+    "roiFront": "355,186,34,104",
+    "roiBack": "355,186,34,104",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "契灵商店"

BIN
tasks/RichMan/mall/navbar/navbar_mall_bondlings_check.png


+ 6 - 6
tasks/RichMan/mall/scales.py

@@ -13,7 +13,7 @@ from tasks.RichMan.config import Scales as ScalesConfig
 from tasks.Utils.config_enum import DemonClass
 
 
-class Scales(MallNavbar, Buy):
+class Scales(Buy, MallNavbar):
 
     def execute_scales(self, con: ScalesConfig=None):
         if not con:
@@ -95,20 +95,20 @@ class Scales(MallNavbar, Buy):
         # 选择魂
         while 1:
             self.screenshot()
-            if self.appear(self.I_SCA_SIX_STAR) or self.appear(self.I_SCA_REWARD):
+            if self.appear(self.I_SCA_SIX_STAR):
                 logger.info('Scales buy success')
-                time.sleep(1)
+                time.sleep(1.8)
                 while 1:
                     self.screenshot()
                     if not self.appear(self.I_SCA_SIX_STAR):
                         break
-                    if self.click(self.C_SCA_SOULS_GET, interval=1):
+                    if self.click(self.C_SCA_SOULS_GET, interval=1.6):
                         continue
                 # 收获购买的东西
                 logger.info('Scales get success')
                 break
 
-            if self.appear_then_click(self.I_SCA_SELECT_1, interval=1):
+            if self.appear_then_click(self.I_SCA_SELECT_1, interval=1.6):
                 continue
 
 
@@ -307,7 +307,7 @@ class Scales(MallNavbar, Buy):
             for i in range(buy_cycles_number):
                 self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK)
                 time.sleep(0.5)
-        if buy_res_number:
+        if buy_res_number and buy_rule >= 2:
             self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK, buy_res_number)
             time.sleep(0.5)
 

+ 1 - 1
tasks/RichMan/mall/special.py

@@ -14,7 +14,7 @@ from tasks.RichMan.assets import RichManAssets
 from tasks.RichMan.config import SpecialRoom
 
 
-class Special(MallNavbar, Buy):
+class Special(Buy, MallNavbar):
 
     def execute_special(self, con: SpecialRoom = None):
         if not con:

+ 9 - 4
tasks/RichMan/script_task.py

@@ -9,18 +9,20 @@ from module.exception import TaskEnd
 
 
 from tasks.RichMan.assets import RichManAssets
+from tasks.RichMan.config import RichMan
 from tasks.RichMan.mall.mall import Mall
 from tasks.RichMan.guild import Guild
 from tasks.RichMan.shrine import Shrine
 from tasks.RichMan.thousand_things import ThousandThings
 
 
-class ScriptTask(ThousandThings, Shrine, Guild, Mall, RichManAssets):
+class ScriptTask(Mall, Guild, ThousandThings, Shrine):
 
     def run(self):
-        self.execute_tt()
-        self.execute_shrine()
-        self.execute_guild()
+        con: RichMan = self.config.rich_man
+        self.execute_tt(con.thousand_things)
+        self.execute_shrine(con.shrine)
+        self.execute_guild(con.guild_store)
         self.execute_mall()
 
         self.set_next_run(task='RichMan', success=True, finish=False)
@@ -47,4 +49,7 @@ if __name__ == '__main__':
     d = Device(c)
     t = ScriptTask(c, d)
 
+    t.execute_mall()
+
+
 

+ 7 - 1
tasks/RichMan/thousand_things.py

@@ -101,13 +101,19 @@ class ThousandThings(GameUi, RichManAssets):
         if not self.tt_check_money(600):
             return False
         self.O_TT_NUMBER.keyword = '2'
+        click_count = 0
         while 1:
             self.screenshot()
             if self.ocr_appear(self.O_TT_NUMBER):
                 break
+            appear_max = self.appear(self.I_TT_BUY_UP)
+            if click_count >= 4:
+                logger.warning('Buy ap failed')
+                break
             if self.appear_then_click(self.I_TT_BUY_UP, interval=0.5):
+                click_count += 1
                 continue
-            if self.ocr_appear_click(self.O_TT_AP, interval=1):
+            if not appear_max and self.ocr_appear_click(self.O_TT_AP, interval=2.3):
                 continue
         logger.info('Buy ap')
         self.ui_get_reward(self.I_TT_BUY_CONFIRM)