Class OpponentTiming
java.lang.Object
privbot.mechanics.OpponentTiming
Pure timing rules adapted from ElorinPvP's opponent clock; no client reads or claimed hit observations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intmeasuredLag(List<Integer> samples) Median lag from at least five valid samples; otherwise zero, the conservative same-tick estimate.static intnextPossibleHit(int now, Integer lockedSince, Integer swingTick, Integer swingSpeed, Integer hitLag, Boolean switchedToInstant) Estimated earliest next hit.
-
Field Details
-
MIN_LAG_SAMPLES
public static final int MIN_LAG_SAMPLES- See Also:
-
FRESH_LOCK_TICKS
public static final int FRESH_LOCK_TICKS- See Also:
-
-
Method Details
-
nextPossibleHit
public static int nextPossibleHit(int now, Integer lockedSince, Integer swingTick, Integer swingSpeed, Integer hitLag, Boolean switchedToInstant) Estimated earliest next hit. Unknown, a fresh lock, invalid observations, and a possible instant weapon all answernow, not a safe future tick. The last swing's speed is retained through ordinary weapon switches; the caller must mark a switch into an instant special weapon as true, or null if it cannot be ruled out. This is a prediction, not proof that damage will or will not arrive. -
measuredLag
-