medal.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_3, 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_3, 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_3, buy_money=120)
  32. # 随机御魂
  33. if con.random_soul:
  34. self.buy_mall_one(buy_button=self.I_ME_SOULS, buy_check=self.I_ME_CHECK_SOULS,
  35. money_ocr=self.O_MALL_RESOURCE_5, buy_money=320)
  36. # 两颗白蛋
  37. if con.white_daruma:
  38. self.buy_mall_more(buy_button=self.I_ME_WHITE, remain_number=True, money_ocr=self.O_MALL_RESOURCE_3,
  39. buy_number=2, buy_max=2, buy_money=100)
  40. # 十张挑战券
  41. if con.challenge_pass:
  42. self.buy_mall_more(buy_button=self.I_ME_CHALLENGE_PASS, remain_number=True, money_ocr=self.O_MALL_RESOURCE_3,
  43. buy_number=con.challenge_pass, buy_max=10, buy_money=30)
  44. # 红蛋
  45. if con.red_daruma:
  46. self.buy_mall_more(buy_button=self.I_ME_RED, remain_number=False,
  47. money_ocr=self.O_MALL_RESOURCE_3,
  48. buy_number=con.red_daruma, buy_max=99, buy_money=30)
  49. # 破碎的咒符
  50. if con.broken_amulet:
  51. self.buy_mall_more(buy_button=self.I_ME_BROKEN, remain_number=False,
  52. money_ocr=self.O_MALL_RESOURCE_3,
  53. buy_number=con.broken_amulet, buy_max=99, buy_money=20)
  54. time.sleep(1)
  55. if __name__ == '__main__':
  56. from module.config.config import Config
  57. from module.device.device import Device
  58. c = Config('oas1')
  59. d = Device(c)
  60. t = Medal(c, d)
  61. t.execute_medal()