Class RestockTarget

java.lang.Object
privbot.mechanics.RestockTarget

public final class RestockTarget extends Object
What a restock should end with, the same on every server: an optional worn setup, an optional carried setup, whether to empty the backpack of unwanted items first, and an optional server preset to try before withdrawing.

Pass it to ctx.restock.to(target). The job proves its work against the two setups, never against the preset: a preset is only a speed-up, and whatever it did not bring is withdrawn by item id (never by name: two pieces can share a name).

A target with neither setup (or two empty ones) is "empty": the job refuses it with FAILED "empty target: nothing to restock to" rather than reporting DONE for doing nothing. Immutable; pure (no game reads).

  • Method Details

    • builder

      public static RestockTarget.Builder builder()
      Returns:
      a new builder (depositFirst true, no setups, no preset)
    • worn

      public GearSetup worn()
      Returns:
      the worn setup to end wearing, or null when the target says nothing about worn gear
    • carried

      public GearSetup carried()
      Returns:
      the carried setup to end carrying, or null when the target says nothing about the backpack
    • depositFirst

      public boolean depositFirst()
      Returns:
      true (the default) to deposit the whole inventory whenever it holds anything the carried setup does not allow (loot, gear the equip swapped out), before withdrawing; the allowed items are withdrawn again by the diff, so they are carried at the end. With this on, the target is met only when nothing unwanted is carried. Without a carried setup nothing counts as unwanted.
    • preset

      public String preset()
      Returns:
      the server preset name or number to try first, or null for none
    • isEmpty

      public boolean isEmpty()
      Returns:
      true when neither setup names anything (nothing to restock to)
    • toString

      public String toString()
      Overrides:
      toString in class Object