Class GrandExchange

java.lang.Object
com.botwithus.bot.api.util.GrandExchange

public final class GrandExchange extends Object
Convenience wrapper around the Grand Exchange interface (STOCKMARKET, iface 105) and its collect-all panel (STOCKMARKET_COLLECTALL, iface 651).

Only the interface probe and the button clicks live here. Offer state (per-slot item, status, progress) is not exposed yet: the producer RPC that used to publish it was removed and nothing replaces it, so there is no read that could answer truthfully.

Every interface and component is addressed by its gameval name through GameAPI.gamevals(); the literal ids are the fallback for a host with no gameval index deployed.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Collect-all panel interface id.
    static final int
    GE interface id.
    static final int
    Number of offer slots.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    abortOffer(int slot)
    Click the abort button of offer slot (0-based) on the offer summary.
    boolean
    Click "Collect to inventory" on the collect-all panel.
    boolean
    Click "Collect to bank" on the collect-all panel.
    boolean
    True when the GE interface is open.
    boolean
    queueComponentClick(int componentId, int optionIndex)
    Click an arbitrary GE component by id with the given right-click option.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INTERFACE_ID

      public static final int INTERFACE_ID
      GE interface id.
      See Also:
    • COLLECT_INTERFACE_ID

      public static final int COLLECT_INTERFACE_ID
      Collect-all panel interface id.
      See Also:
    • SLOT_COUNT

      public static final int SLOT_COUNT
      Number of offer slots.
      See Also:
  • Constructor Details

    • GrandExchange

      public GrandExchange(GameAPI api)
  • Method Details

    • isOpen

      public boolean isOpen()
      True when the GE interface is open.
    • collectAll

      public boolean collectAll()
      Click "Collect to inventory" on the collect-all panel. No-op when the GE isn't open.
    • collectToBank

      public boolean collectToBank()
      Click "Collect to bank" on the collect-all panel. No-op when the GE isn't open.
    • abortOffer

      public boolean abortOffer(int slot)
      Click the abort button of offer slot (0-based) on the offer summary. No-op when the GE isn't open or slot is out of range.
    • queueComponentClick

      public boolean queueComponentClick(int componentId, int optionIndex)
      Click an arbitrary GE component by id with the given right-click option. Escape hatch for callers that know the exact button id; prefer the named helpers above where they exist.