medal.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. import time
  5. from module.logger import logger
  6. from tasks.GameUi.page import page_main, page_guild
  7. from tasks.GameUi.game_ui import GameUi
  8. from tasks.Component.Buy.buy import Buy
  9. from tasks.RichMan.assets import RichManAssets
  10. from tasks.RichMan.config import MedalRoom
  11. from tasks.RichMan.mall.friendship_points import FriendshipPoints
  12. class Medal(FriendshipPoints):
  13. def execute_medal(self, con: MedalRoom = None):
  14. if not con:
  15. con = self.config.rich_man.medal_room
  16. if not con.enable:
  17. logger.info('Medal is not enable')
  18. return
  19. self._enter_medal()
  20. # 黑蛋
  21. if con.black_daruma:
  22. self.buy_mall_one(buy_button=self.I_ME_BLACK, buy_check=self.I_ME_CHECK_BLACK,
  23. money_ocr=self.O_MALL_RESOURCE_5, buy_money=480)
  24. # 蓝票
  25. if con.mystery_amulet:
  26. self.buy_mall_one(buy_button=self.I_ME_BLUE, buy_check=self.I_ME_CHECK_BLUE,
  27. money_ocr=self.O_MALL_RESOURCE_5, buy_money=180)
  28. # 体力100
  29. if con.ap_100:
  30. self.buy_mall_one(buy_button=self.I_ME_AP, buy_check=self.I_ME_CHECK_AP,
  31. money_ocr=self.O_MALL_RESOURCE_5, buy_money=120)
  32. # 随机御魂
  33. if con.random_soul:
  34. pass
  35. # self.buy_mall_one(buy_button=self.I_ME_SOULS, buy_check=self.I_ME_CHECK_SOULS,
  36. # money_ocr=self.O_MALL_RESOURCE_5, buy_money=320)
  37. # 两颗白蛋
  38. if con.white_daruma:
  39. self.buy_mall_more(buy_button=self.I_ME_WHITE, remain_number=True, money_ocr=self.O_MALL_RESOURCE_5,
  40. buy_number=2, buy_max=2, buy_money=100)
  41. # 十张挑战券
  42. if con.challenge_pass:
  43. self.buy_mall_more(buy_button=self.I_ME_CHALLENGE_PASS, remain_number=True, money_ocr=self.O_MALL_RESOURCE_5,
  44. buy_number=con.challenge_pass, buy_max=10, buy_money=30)
  45. # 红蛋
  46. if con.red_daruma:
  47. self.buy_mall_more(buy_button=self.I_ME_RED, remain_number=False,
  48. money_ocr=self.O_MALL_RESOURCE_5,
  49. buy_number=con.red_daruma, buy_max=99, buy_money=30)
  50. # 破碎的咒符
  51. if con.broken_amulet:
  52. self.buy_mall_more(buy_button=self.I_ME_BROKEN, remain_number=False,
  53. money_ocr=self.O_MALL_RESOURCE_5,
  54. buy_number=con.broken_amulet, buy_max=99, buy_money=20)
  55. time.sleep(1)
  56. if __name__ == '__main__':
  57. from module.config.config import Config
  58. from module.device.device import Device
  59. c = Config('test')
  60. d = Device(c)
  61. t = Medal(c, d)
  62. t.execute_medal()