Skip to content

Commit

Permalink
Fix: #421
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Dec 31, 2024
1 parent d5c80b2 commit ad1fef0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/power/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ def get_power(crop, type="trailblaze_power"):
try:
if type == "trailblaze_power":
result = auto.get_single_line_text(
crop=crop, blacklist=['+', '米'], max_retries=3)
crop=crop, blacklist=['+', '米', '*'], max_retries=3)
power = int(result.replace("1240", "/240").replace("?", "").split('/')[0])
return power if 0 <= power <= 999 else -1
return power if 0 <= power <= 999 else 0
elif type == "reserved_trailblaze_power":
result = auto.get_single_line_text(
crop=crop, blacklist=['+', '米'], max_retries=3)
power = int(result[0])
return power if 0 <= power <= 2400 else -1
return power if 0 <= power <= 2400 else 0
except Exception as e:
log.error(f"识别开拓力失败: {e}")
return -1
return 0

def move_button_and_confirm():
if auto.click_element("./assets/images/zh_CN/base/confirm.png", "image", 0.9, max_retries=10):
Expand Down

0 comments on commit ad1fef0

Please sign in to comment.