Schedule hatch filling independently every 1-2 seconds
This commit is contained in:
@@ -532,6 +532,12 @@ class Planner:
|
||||
self.notes.append(f"{name} 已保留:{reason}")
|
||||
if actions:
|
||||
return self.batch_actions(actions, snapshot, policy)
|
||||
return self.hatch_actions(snapshot, policy) or self.purchase(snapshot, policy, daily_left)
|
||||
|
||||
def hatch_actions(self, snapshot, policy):
|
||||
if not policy.enabled or not policy.fill:
|
||||
return []
|
||||
actions = []
|
||||
vip_info = snapshot.raw.get("activityHistory", {}).get("vipInfo") or {}
|
||||
vip = seconds(vip_info.get("vipTime")) > snapshot.now
|
||||
empty = [s for s in snapshot.raw["stacks"] if policy.fill and int(s.get("monsterId") or 0) <= 0 and (int(s.get("position", -1)) != 3 or vip)]
|
||||
@@ -556,7 +562,7 @@ class Planner:
|
||||
self.notes.append("有空坑,当前没有符合已勾选规则和保留数量的蛋" if policy.manual_eggs else "有空坑,当前没有符合星级、收益和保留数量设置的蛋")
|
||||
if not actions and not self.notes:
|
||||
self.notes.append("等待孵化 / 成长,成熟后按保护条件处理")
|
||||
return actions or self.purchase(snapshot, policy, daily_left)
|
||||
return actions
|
||||
|
||||
def batch_actions(self, actions, snapshot, policy):
|
||||
monsters = snapshot.monsters
|
||||
|
||||
Reference in New Issue
Block a user