Skip to content

Commit

Permalink
update plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Akegarasu committed May 9, 2022
1 parent dae88ee commit c8c23ec
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 50 deletions.
1 change: 1 addition & 0 deletions ok-derby-backend/plugins/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def install(self) -> None:
auto_derby.config.pause_if_race_order_gt = 999
auto_derby.plugin.install("no_ocr_prompt")
auto_derby.plugin.install("no_event_prompt")
auto_derby.plugin.install("no_item_prompt")
auto_derby.plugin.install("auto_crane")


Expand Down
2 changes: 1 addition & 1 deletion ok-derby-backend/plugins/auto_crane.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def play(ctx: single_mode.Context):
for duration in (2.2, 1.8, 1.2):
for duration in (2, 1.6, 1):
_, pos = action.wait_image(templates.SINGLE_MODE_CRANE_GAME_BUTTON)
time.sleep(3)
_, pos = action.wait_image(templates.SINGLE_MODE_CRANE_GAME_BUTTON)
Expand Down
3 changes: 3 additions & 0 deletions ok-derby-backend/plugins/limited_sale_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ def install(self) -> None:


auto_derby.plugin.register(__name__, Plugin())

# Deprecated: remove at next major version
auto_derby.plugin.register("limited_sale_close", Plugin())
9 changes: 9 additions & 0 deletions ok-derby-backend/plugins/no_item_prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import auto_derby


class Plugin(auto_derby.Plugin):
def install(self) -> None:
auto_derby.config.single_mode_item_prompt_disabled = True


auto_derby.plugin.register(__name__, Plugin())
13 changes: 13 additions & 0 deletions ok-derby-backend/plugins/no_race_retry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import auto_derby
from auto_derby.single_mode import Context, RaceResult


class Plugin(auto_derby.Plugin):
def install(self) -> None:
def _should_retry_race(ctx: Context, result: RaceResult) -> bool:
return False

auto_derby.config.single_mode_should_retry_race = _should_retry_race


auto_derby.plugin.register(__name__, Plugin())
60 changes: 11 additions & 49 deletions ok-derby-backend/plugins/race_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,69 +143,31 @@ def score(self, ctx: single_mode.Context) -> float:
auto_derby.plugin.register(__name__, Plugin())


# https://dmg.umamusume.jp/news/detail?id=550
# story event: 瑞花繚乱!新春かるた合戦
_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"宝塚記念",
order_lte=3,
),
)

_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"天皇賞(春)",
order_lte=3,
),
)

_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"ジャパンカップ",
order_lte=3,
),
)
# 春のGⅠ記念ミッション 第2弾 NHKマイルC

_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"有馬記念",
order_lte=3,
datetime.datetime(2022, 5, 2, 4, 0, tzinfo=JST),
datetime.datetime(2022, 5, 9, 3, 59, tzinfo=JST),
"NHKマイルカップ",
order_lte=1,
),
)


_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"フェブラリーステークス",
order_lte=3,
),
)


_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"エルムステークス",
datetime.datetime(2022, 5, 2, 4, 0, tzinfo=JST),
datetime.datetime(2022, 5, 9, 3, 59, tzinfo=JST),
"アーリントンカップ",
order_lte=3,
),
)

_add_compagin(
OneTimeCampaign(
datetime.datetime(2021, 12, 31, 12, 0, tzinfo=JST),
datetime.datetime(2022, 1, 11, 11, 59, tzinfo=JST),
"JBCスプリント",
datetime.datetime(2022, 5, 2, 4, 0, tzinfo=JST),
datetime.datetime(2022, 5, 9, 3, 59, tzinfo=JST),
"ニュージーランドトロフィー",
order_lte=3,
),
)

0 comments on commit c8c23ec

Please sign in to comment.