Skip to content

Commit

Permalink
fix(nurturing): confirm race until get into race
Browse files Browse the repository at this point in the history
* fix(nurturing): confirm race until get into race

* fix(nurturing): wait 0.5sec before choose running style to avoid transition

* refactor: remove wait_click_image_disappear

Co-authored-by: NateScarlet <NateScarlet@Gmail.com>
  • Loading branch information
Small-Ku and NateScarlet committed Jun 20, 2021
1 parent 14ed359 commit a93c861
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions auto_derby/jobs/nurturing.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def _choose_running_style(ctx: Context, race1: race.Race) -> None:
LOGGER.info("running style score:\t%.2f:\t%s", score, name)

_, pos = action.wait_image(templates.RACE_CONFIRM_BUTTON)
time.sleep(0.5)
action.click(style_scores[0][2])
action.click(pos)

Expand All @@ -206,8 +207,11 @@ def _handle_race(ctx: Context, race1: Optional[race.Race] = None):
finally:
close_msg()

action.wait_click_image(templates.SINGLE_MODE_RACE_START_BUTTON)
action.wait_click_image(templates.SINGLE_MODE_RACE_START_BUTTON)
for _, pos in action.match_image_until_disappear(
templates.SINGLE_MODE_RACE_START_BUTTON
):
action.click(pos)
time.sleep(0.5)
action.wait_image(templates.RACE_RESULT_BUTTON)
ctx.race_turns.add(ctx.turn_count())

Expand Down

0 comments on commit a93c861

Please sign in to comment.