Class AttackTiming

java.lang.Object
privbot.mechanics.AttackTiming

public final class AttackTiming extends Object
Pure attack timing calculations, adapted from ElorinPvP's AttackClock. The caller supplies observed fires and confirmed eats; a sent click is not evidence that an attack fired. This type does not read the client. Unknown observations are null, and a deadline passing means an unconfirmed send expired, not that it failed.
  • Field Details

  • Method Details

    • readyTick

      public static Integer readyTick(Integer estimatedReady, Integer spellFloor)
      Combine a known attack-ready estimate with the observed spell cooldown floor. Null remains unknown.
    • stepWindow

      public static AttackTiming.Window stepWindow(Integer firedTick, Integer estimatedReady)
      Window from the last confirmed fire until two ticks before the estimated next attack.
    • estimatedReady

      public static Integer estimatedReady(Integer firedTick, CombatStyle style, String weapon, Integer eats, Map<String,Integer> weaponOverrides)
      The estimated next fire tick, or null if the fire, style, or eat count is unreadable.
    • deadline

      public static Integer deadline(Integer sentTick, Integer estimatedReady)
      The last pending tick; null if the send or ready estimate is unreadable. When it is known that no attack has fired yet, the caller may use the send tick as the ready estimate.
    • pending

      public static Boolean pending(int tick, Integer sentTick, Integer estimatedReady, Boolean unsettled)
      Whether a known unsettled send is still in its pending window; null if unsettled or send is unreadable.
    • expiresNow

      public static Boolean expiresNow(int tick, Integer previousTick, Integer sentTick, Integer estimatedReady, Boolean unsettled)
      Whether this sample is the first past the deadline, including when samples skip ticks; null if unknown.
    • eatCost

      public static int eatCost(int readyTick, int processedTick, Integer heldUntil)
      Attack ticks lost to an eat processed at processedTick; a separate hold may absorb the delay.