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

use RuleImage.build_mall_resource_ocr(self.device.image) to replace ruleocr

Migs 10 месяцев назад
Родитель
Сommit
c3c25924a0

+ 2 - 2
tasks/RichMan/mall/charisma.py

@@ -25,12 +25,12 @@ class Charisma(FriendshipPoints):
         # 黑色碎片
         if con.black_daruma_scrap:
             self.buy_mall_more(buy_button=self.I_CH_BLACK, remain_number=True,
-                               money_ocr=self.O_MALL_RESOURCE_5,
+                               money_ocr=self.I_MALL_RESOURCE_CHARISMA.build_mall_resource_ocr(self.device.image),
                                buy_number=2, buy_max=2, buy_money=320)
         # 蓝票
         if con.mystery_amulet:
             self.buy_mall_one(buy_button=self.I_CH_BLUE, buy_check=self.I_CH_CHECK_BLUE,
-                              money_ocr=self.O_MALL_RESOURCE_5, buy_money=400)
+                              money_ocr=self.I_MALL_RESOURCE_CHARISMA.build_mall_resource_ocr(self.device.image), buy_money=400)
 
 
 

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

@@ -24,12 +24,12 @@ class FriendshipPoints(Special):
         # 购买
         if con.white_daruma:
             self.buy_mall_one(buy_button=self.I_FS_WHITE_CLICK, buy_check=self.I_FS_WHITE_CHECK,
-                              money_ocr=self.O_MALL_RESOURCE_5, buy_money=1000)
+                              money_ocr=self.I_MALL_RESOURCE_FRIENDS.build_mall_resource_ocr(self.device.image), buy_money=1000)
         if con.red_daruma != 0:
-            self.buy_mall_more(buy_button=self.I_FS_RED, remain_number=False, money_ocr=self.O_MALL_RESOURCE_5,
+            self.buy_mall_more(buy_button=self.I_FS_RED, remain_number=False, money_ocr=self.I_MALL_RESOURCE_FRIENDS.build_mall_resource_ocr(self.device.image),
                                buy_number=con.red_daruma, buy_max=99, buy_money=150)
         if con.broken_amulet != 0:
-            self.buy_mall_more(buy_button=self.I_FS_BROKEN, remain_number=False, money_ocr=self.O_MALL_RESOURCE_5,
+            self.buy_mall_more(buy_button=self.I_FS_BROKEN, remain_number=False, money_ocr=self.I_MALL_RESOURCE_FRIENDS.build_mall_resource_ocr(self.device.image),
                                buy_number=con.broken_amulet, buy_max=99, buy_money=100)
 
     def buy_mall_one(self, buy_button: RuleImage, buy_check: RuleImage, money_ocr: RuleOcr, buy_money: int):
@@ -129,7 +129,7 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
 
-    c = Config('oas1')
+    c = Config('debug')
     d = Device(c)
     t = FriendshipPoints(c, d)
 

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

@@ -41,21 +41,21 @@ class Medal(FriendshipPoints):
                               money_ocr=self.O_MALL_RESOURCE_3, 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_3,
+            self.buy_mall_more(buy_button=self.I_ME_WHITE, remain_number=True, money_ocr=self.I_MALL_RESOURCE_MEDAL.build_mall_resource_ocr(self.device.image),
                                buy_number=2, buy_max=2, buy_money=100)
         # 十张挑战券
         if con.challenge_pass:
-            self.buy_mall_more(buy_button=self.I_ME_CHALLENGE_PASS, remain_number=True, money_ocr=self.O_MALL_RESOURCE_3,
+            self.buy_mall_more(buy_button=self.I_ME_CHALLENGE_PASS, remain_number=True, money_ocr=self.I_MALL_RESOURCE_MEDAL.build_mall_resource_ocr(self.device.image),
                                buy_number=con.challenge_pass, buy_max=10, buy_money=30)
         # 红蛋
         if con.red_daruma:
             self.buy_mall_more(buy_button=self.I_ME_RED, remain_number=False,
-                               money_ocr=self.O_MALL_RESOURCE_3,
+                               money_ocr=self.I_MALL_RESOURCE_MEDAL.build_mall_resource_ocr(self.device.image),
                                buy_number=con.red_daruma, buy_max=99, buy_money=30)
         # 破碎的咒符
         if con.broken_amulet:
             self.buy_mall_more(buy_button=self.I_ME_BROKEN, remain_number=False,
-                               money_ocr=self.O_MALL_RESOURCE_3,
+                               money_ocr=self.I_MALL_RESOURCE_MEDAL.build_mall_resource_ocr(self.device.image),
                                buy_number=con.broken_amulet, buy_max=99, buy_money=20)
 
         time.sleep(1)