Class ConsumableSelectionOrder

java.lang.Object
privbot.query.ConsumableSelectionOrder

public final class ConsumableSelectionOrder extends Object
Stable ordering for inventory consumables when multiple slots match (e.g. several same-tier potions). Prefer finishing nearly-empty vials before full ones.
  • Method Details

    • potionDoseTierFromName

      public static int potionDoseTierFromName(String itemName)
      Parses dose from potion-style display names using the last (n) group (e.g. Xeric's aid (+)(4) → 4). Items without a dose marker return 5 so they sort after explicit (1)–(4) tiers. A null or empty name returns 9.
    • lowestPotionDoseThenLowestSlot

      public static Comparator<PrivItem> lowestPotionDoseThenLowestSlot()
      Prefer lowest dose tier (1 sip left) first, then earlier inventory slots for the same tier so one vial is drained via repeated ticks instead of one sip per matching item id.