39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
"""Tactical Challenge Shop (戦術対抗戦) daily task. Ported from baas-reference
|
|
module/shop/tactical_challenge_shop.py's implement() -- see shop_utils.py for
|
|
the shared checkbox-grid-then-bulk-buy control flow both shop tabs use.
|
|
|
|
The reference reaches this tab via goto_shop_by_name's OCR swipe-search over
|
|
the shop-type tab list (module/shop/shop_utils.py), needed there because that
|
|
list can require scrolling. This account's tab list is only 7 entries and
|
|
fits on screen with no scrolling, confirmed live -- config.SHOP_TAB_TACTICAL
|
|
is a fixed click on the already-visible tab, not a shortcut around OCR (there
|
|
is nothing to search for)."""
|
|
from ba_auto import navigation
|
|
from ba_auto.tasks import shop_utils
|
|
|
|
|
|
def run(driver, config):
|
|
driver.focus_game()
|
|
|
|
driver.click(*config.SHOP_ICON)
|
|
driver.wait(2)
|
|
if not navigation.is_on_subscreen(driver):
|
|
print("[shop_tactical] could not confirm shop opened, aborting without pressing further keys")
|
|
return
|
|
|
|
shop_utils.run_shop_tab(
|
|
driver, config,
|
|
tab_button=config.SHOP_TAB_TACTICAL,
|
|
targets=config.TACTICAL_SHOP_TARGETS,
|
|
balance_rect=config.TACTICAL_COIN_OCR_RECT,
|
|
currency_label="tactical coin",
|
|
)
|
|
|
|
# navigation.return_to_home over a bare click -- verified + carries the
|
|
# XIGNCODE-overlay recovery escalation return_to_home has (see its
|
|
# docstring); an unverified click here was a real gap found in a
|
|
# 2026-07-12 audit of every direct BACK_BUTTON usage in this project.
|
|
if not navigation.return_to_home(driver):
|
|
print("[shop_tactical] warning: could not confirm return to home screen")
|
|
print("[shop_tactical] Done.")
|