Class RestockCycle
java.lang.Object
privbot.restock.RestockCycle
One restock trip as a stage machine: IDLE --begin--> HOME -> POOL -> BANK -> RETURNING -> IDLE. The routine is the
between-fight one on Elorin (Home teleport, Drink-from the Healing font, Last-preset at the bank, the teleport menu's
"Previous" back to the activity), first built inside a boss plugin and lifted here so any
plugin can run it with
RestockRunner.
Pure state: the stage, the failures on it, the trips made and why the current one began. A step whose confirmation
fails MAX_FAILURES times ends in STOPPED with the reason, and the plugin stops automation. Every method is
synchronized: the tick thread starts trips, the script worker advances them, the HUD reads them.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA confirmation that failed this many times on one stage stops the trip with its reason. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()advance(long now) The current stage's step was confirmed: the next stage.booleanBegins a trip from IDLE.booleanThe current stage's confirmation failed.intfailures()label()The HUD's line: the stage, and the stop reason once stopped.reason()Why the current (or last) trip began.voidreset(long now) A new Start: idle, counts cleared.stage()longvoidStops at once with the reason (no retry would help).booleanstopped()inttrips()long
-
Field Details
-
MAX_FAILURES
public static final int MAX_FAILURESA confirmation that failed this many times on one stage stops the trip with its reason.- See Also:
-
-
Constructor Details
-
RestockCycle
public RestockCycle()
-
-
Method Details
-
stage
-
active
public boolean active() -
stopped
public boolean stopped() -
stageSince
public long stageSince() -
tripStartedAt
public long tripStartedAt() -
failures
public int failures() -
trips
public int trips() -
reason
Why the current (or last) trip began. -
stopReason
-
reset
public void reset(long now) A new Start: idle, counts cleared. -
begin
Begins a trip from IDLE. Returns false while one is under way or the cycle is stopped. -
advance
The current stage's step was confirmed: the next stage. RETURNING ends the trip (IDLE, one more trip counted). -
fail
The current stage's confirmation failed. Returns true when that was theMAX_FAILURESth: the cycle is then STOPPED with the reason. Ignored while idle or stopped. -
stopNow
Stops at once with the reason (no retry would help). -
label
The HUD's line: the stage, and the stop reason once stopped.
-