From c8c23ecdfbeef050d6b190730c931b3abfbbf1d9 Mon Sep 17 00:00:00 2001 From: Akiba Date: Mon, 9 May 2022 15:18:23 +0800 Subject: [PATCH] update plugins --- ok-derby-backend/plugins/afk.py | 1 + ok-derby-backend/plugins/auto_crane.py | 2 +- .../plugins/limited_sale_ignore.py | 3 + ok-derby-backend/plugins/no_item_prompt.py | 9 +++ ok-derby-backend/plugins/no_race_retry.py | 13 ++++ ok-derby-backend/plugins/race_campaign.py | 60 ++++--------------- 6 files changed, 38 insertions(+), 50 deletions(-) create mode 100644 ok-derby-backend/plugins/no_item_prompt.py create mode 100644 ok-derby-backend/plugins/no_race_retry.py diff --git a/ok-derby-backend/plugins/afk.py b/ok-derby-backend/plugins/afk.py index 71ce815..6ee74d8 100644 --- a/ok-derby-backend/plugins/afk.py +++ b/ok-derby-backend/plugins/afk.py @@ -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") diff --git a/ok-derby-backend/plugins/auto_crane.py b/ok-derby-backend/plugins/auto_crane.py index 3f69abd..84c6c9a 100644 --- a/ok-derby-backend/plugins/auto_crane.py +++ b/ok-derby-backend/plugins/auto_crane.py @@ -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) diff --git a/ok-derby-backend/plugins/limited_sale_ignore.py b/ok-derby-backend/plugins/limited_sale_ignore.py index 50f569b..636ebaa 100644 --- a/ok-derby-backend/plugins/limited_sale_ignore.py +++ b/ok-derby-backend/plugins/limited_sale_ignore.py @@ -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()) diff --git a/ok-derby-backend/plugins/no_item_prompt.py b/ok-derby-backend/plugins/no_item_prompt.py new file mode 100644 index 0000000..12a3d41 --- /dev/null +++ b/ok-derby-backend/plugins/no_item_prompt.py @@ -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()) diff --git a/ok-derby-backend/plugins/no_race_retry.py b/ok-derby-backend/plugins/no_race_retry.py new file mode 100644 index 0000000..1fdc7a4 --- /dev/null +++ b/ok-derby-backend/plugins/no_race_retry.py @@ -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()) diff --git a/ok-derby-backend/plugins/race_campaign.py b/ok-derby-backend/plugins/race_campaign.py index 3a922ea..5b5d901 100644 --- a/ok-derby-backend/plugins/race_campaign.py +++ b/ok-derby-backend/plugins/race_campaign.py @@ -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, ), )