MCPcopy Create free account
hub / github.com/runhey/OnmyojiAutoScript / check_score

Method check_score

tasks/Duel/script_task.py:96–110  ·  view source on GitHub ↗

检查是否达到目标分数 :param target: 目标分数 :return:

(self, target: int)

Source from the content-addressed store, hash-verified

94 return False
95
96 def check_score(self, target: int) -> int or None:
97 """
98 检查是否达到目标分数
99 :param target: 目标分数
100 :return:
101 """
102 while 1:
103 self.screenshot()
104 if self.appear(self.I_D_CELEB_STAR) or self.appear(self.I_D_CELEB_HONOR):
105 logger.info('You are already a celeb')
106 return None
107 current_score = self.O_D_SCORE.ocr(self.device.image)
108 if current_score < 1200 or current_score > 3000:
109 continue
110 return current_score if current_score <= target else None
111
112 def duel_one(self, current_score: int, enable: bool=False,
113 mark_mode: GreenMarkType=GreenMarkType.GREEN_MAIN) -> bool:

Callers 1

runMethod · 0.95

Calls 3

appearMethod · 0.80
ocrMethod · 0.80
screenshotMethod · 0.45

Tested by

no test coverage detected