Fix exploration member selection and automatic reward collection
This commit is contained in:
+13
-3
@@ -1615,15 +1615,25 @@ class Window(ExplorationPages, ProgressionPages, ActivityPages, W.QMainWindow):
|
||||
def arm_extended_automation(self):
|
||||
active = self.monitoring and self.strategy_toggle.isChecked() and not self.closed and self.engine.snapshot is not None
|
||||
plans = self.latest_render[1] if self.latest_render else []
|
||||
explore = active and self.explore_enabled.isChecked() and any(
|
||||
explore_ready = active and self.explore_enabled.isChecked() and any(
|
||||
action.kind in ("explore_start", "explore_finish") and action.path for action in plans)
|
||||
breakthrough = active and bool(self.breakthrough_targets) and any(
|
||||
action.kind in ("potential", "breakthrough") for action in plans)
|
||||
now = time.monotonic()
|
||||
for kind, enabled in (("explore", explore), ("breakthrough", breakthrough)):
|
||||
explore_delay = 1.0 if explore_ready else None
|
||||
if active and self.explore_enabled.isChecked() and self.engine.snapshot is not None:
|
||||
for team in self.engine.snapshot.raw.get("exploreTeams") or []:
|
||||
if not isinstance(team, dict) or team.get("status") not in (1, "1"):
|
||||
continue
|
||||
remaining = self.engine.explore_planner.remaining(self.engine.snapshot, team)
|
||||
if remaining is not None:
|
||||
delay = max(1.0, remaining + 1)
|
||||
explore_delay = delay if explore_delay is None else min(explore_delay, delay)
|
||||
for kind, enabled, dispatch_delay in (("explore", explore_delay is not None, explore_delay or 1.0),
|
||||
("breakthrough", breakthrough, 1.0)):
|
||||
attribute = "next_" + kind
|
||||
deadline = getattr(self, attribute)
|
||||
setattr(self, attribute, (now + 1 if deadline == float("inf") else deadline) if enabled else float("inf"))
|
||||
setattr(self, attribute, (now + dispatch_delay if deadline == float("inf") else deadline) if enabled else float("inf"))
|
||||
|
||||
def poll_delay(self):
|
||||
return random.uniform(0, self.interval.currentData())
|
||||
|
||||
Reference in New Issue
Block a user