mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-24 12:29:03 +08:00
Fix: Trying to buy action points multiple times
This commit is contained in:
@@ -228,12 +228,15 @@ class ActionPointHandler(UI):
|
|||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
self.action_point_update()
|
self.action_point_update()
|
||||||
cost = self.action_point_get_cost(zone, pinned)
|
cost = self.action_point_get_cost(zone, pinned)
|
||||||
|
buy_checked = False
|
||||||
for _ in range(12):
|
for _ in range(12):
|
||||||
# End
|
# End
|
||||||
if self._action_point_total < self.config.OS_ACTION_POINT_PRESERVE:
|
if self._action_point_total < self.config.OS_ACTION_POINT_PRESERVE:
|
||||||
if self.config.OpsiGeneral_BuyActionPoint:
|
if self.config.OpsiGeneral_BuyActionPoint and not buy_checked:
|
||||||
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
buy_checked = True
|
||||||
logger.info(f'Reach the limit of action points, preserve={self.config.OS_ACTION_POINT_PRESERVE}')
|
logger.info(f'Reach the limit of action points, preserve={self.config.OS_ACTION_POINT_PRESERVE}')
|
||||||
self.action_point_quit()
|
self.action_point_quit()
|
||||||
raise ActionPointLimit
|
raise ActionPointLimit
|
||||||
@@ -243,9 +246,11 @@ class ActionPointHandler(UI):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# Get more action points
|
# Get more action points
|
||||||
if self.config.OpsiGeneral_BuyActionPoint:
|
if self.config.OpsiGeneral_BuyActionPoint and not buy_checked:
|
||||||
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
buy_checked = True
|
||||||
box = [index for index in [3, 2, 1] if self._action_point_box[index] > 0]
|
box = [index for index in [3, 2, 1] if self._action_point_box[index] > 0]
|
||||||
if len(box):
|
if len(box):
|
||||||
self.action_point_set_button(box[0])
|
self.action_point_set_button(box[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user