活动商店购买改进
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful

This commit is contained in:
zhbaor 2025-01-26 20:41:28 +08:00
parent 53a7297e2f
commit 5819f8e96c

View file

@ -37,6 +37,7 @@ class Shop(SceneGraphSolver):
def run(self):
self.notify_shop = False
self.product = None
return super().run()
def next_product(self):
@ -66,6 +67,7 @@ class Shop(SceneGraphSolver):
name = crop2content(name)
name = ocr_rec(name)
if name not in config.conf.activity_shop_blacklist:
self.product = name
return va(top_left, (245, 110))
return None
@ -82,6 +84,9 @@ class Shop(SceneGraphSolver):
return
self.swipe_ext([(1600, 340), (300, 340), (300, 150)], [0.2, 0.3], 0, 0.1)
elif scene == Scene.ACTIVITY_SHOP_BUY:
if self.product is None:
self.scene_graph_step(Scene.ACTIVITY_SHOP)
return
if self.find("sign_in/shop/insufficient"):
return True
if self.animation():
@ -92,12 +97,12 @@ class Shop(SceneGraphSolver):
self.tap(pos, update=False)
self.sleep(0.5, update=False)
self.notify_shop = True
self.tap("sign_in/shop/buy")
self.ctap("sign_in/shop/buy", id=self.product)
elif scene == Scene.MATERIEL:
if self.notify_shop:
self.notify_shop = False
self.sleep()
notify("活动商店物品购买")
notify(f"活动商店物品购买{self.name}")
self.tap((960, 200))
elif scene == Scene.ROGUE_AGENT:
if self.notify_shop: