mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-23 17:55:56 +08:00
Fix: Handle slowly loaded food in dorm (#2707)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import re
|
|
||||||
import time
|
import time
|
||||||
|
import typing as t
|
||||||
|
|
||||||
from module.base.button import ButtonGrid
|
from module.base.button import ButtonGrid
|
||||||
from module.base.decorator import Config, cached_property
|
from module.base.decorator import Config, cached_property
|
||||||
@@ -258,10 +258,28 @@ class RewardDorm(UI):
|
|||||||
Pages:
|
Pages:
|
||||||
in: DORM_FEED_CHECK
|
in: DORM_FEED_CHECK
|
||||||
"""
|
"""
|
||||||
self.device.screenshot()
|
timeout = Timer(1.5, count=3).start()
|
||||||
self.handle_info_bar()
|
food: t.List[Food] = []
|
||||||
|
fill: int = 0
|
||||||
|
skip_first_screenshot = True
|
||||||
|
while 1:
|
||||||
|
if skip_first_screenshot:
|
||||||
|
skip_first_screenshot = False
|
||||||
|
else:
|
||||||
|
self.device.screenshot()
|
||||||
|
|
||||||
food, fill = self.dorm_food_get()
|
# End
|
||||||
|
if timeout.reached():
|
||||||
|
logger.warning('Get dorm food timeout, probably because food is empty')
|
||||||
|
break
|
||||||
|
|
||||||
|
if self.handle_info_bar():
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Get
|
||||||
|
food, fill = self.dorm_food_get()
|
||||||
|
if sum([f.amount for f in food]) > 0:
|
||||||
|
break
|
||||||
|
|
||||||
FOOD_FILTER.load(self.config.Dorm_FeedFilter)
|
FOOD_FILTER.load(self.config.Dorm_FeedFilter)
|
||||||
for selected in FOOD_FILTER.apply(food):
|
for selected in FOOD_FILTER.apply(food):
|
||||||
|
|||||||
Reference in New Issue
Block a user