瀏覽代碼

feat(rich man): done!

runhey 3 年之前
父節點
當前提交
b5b9b7818d
共有 4 個文件被更改,包括 57 次插入 和 6 次删除
  1. 2 0
      tasks/Component/Buy/buy.py
  2. 35 0
      tasks/RichMan/mall/mall.py
  3. 6 3
      tasks/RichMan/mall/medal.py
  4. 14 3
      tasks/RichMan/script_task.py

+ 2 - 0
tasks/Component/Buy/buy.py

@@ -105,6 +105,8 @@ class Buy(BaseTask, BuyAssets):
                 current = self.O_BUY_NUMBER.ocr(self.device.image)
                 if current >= number:
                     break
+                if current == 0:
+                    logger.warning(f'OCR current number failed {current}')
                 number_record.append(current)
                 if len(number_record) >= 4:
                     if number_record[0] == number_record[1] == number_record[2] == number_record[3]:

+ 35 - 0
tasks/RichMan/mall/mall.py

@@ -1,3 +1,38 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
+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.bondlings import Bondlings
+from tasks.GameUi.page import page_main, page_mall
+
+class Mall(Special, Honor, FriendshipPoints, Medal, Charisma, Consignment, Scales, Bondlings):
+
+
+    def execute_mall(self):
+        logger.hr('Mall', 1)
+        self.ui_get_current_page()
+        self.ui_goto(page_mall)
+
+        # 寄售屋
+        self.execute_consignment()
+        # 蛇皮
+        self.execute_scales()
+        # 契灵
+        self.execute_bondlings()
+
+        # 杂货铺
+        self.execute_honor()
+        self.execute_friendship()
+        self.execute_medal()
+        self.execute_charisma()
+
+        # 退出
+        self.back_mall()

+ 6 - 3
tasks/RichMan/mall/medal.py

@@ -37,8 +37,9 @@ class Medal(FriendshipPoints):
                               money_ocr=self.O_MALL_RESOURCE_5, buy_money=120)
         # 随机御魂
         if con.random_soul:
-            self.buy_mall_one(buy_button=self.I_ME_SOULS, buy_check=self.I_ME_CHECK_SOULS,
-                              money_ocr=self.O_MALL_RESOURCE_5, buy_money=320)
+            pass
+            # self.buy_mall_one(buy_button=self.I_ME_SOULS, buy_check=self.I_ME_CHECK_SOULS,
+            #                   money_ocr=self.O_MALL_RESOURCE_5, buy_money=320)
         # 两颗白蛋
         if con.white_daruma:
             self.buy_mall_more(buy_button=self.I_ME_WHITE, remain_number=True, money_ocr=self.O_MALL_RESOURCE_5,
@@ -66,7 +67,9 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
 
-    c = Config('oas1')
+    c = Config('test')
     d = Device(c)
     t = Medal(c, d)
 
+    t.execute_medal()
+

+ 14 - 3
tasks/RichMan/script_task.py

@@ -7,14 +7,25 @@ from datetime import time, datetime, timedelta
 from module.logger import logger
 from module.exception import TaskEnd
 
-from tasks.base_task import BaseTask
+
 from tasks.RichMan.assets import RichManAssets
+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(BaseTask):
+class ScriptTask(ThousandThings, Shrine, Guild, Mall, RichManAssets):
 
     def run(self):
-        pass
+        self.execute_tt()
+        self.execute_shrine()
+        self.execute_guild()
+        self.execute_mall()
+
+        self.set_next_run(task='RichMan', success=True, finish=False)
+
+        raise TaskEnd('RichMan')