Class BankWidgetOps

java.lang.Object
privbot.hooks.bank.BankWidgetOps

public final class BankWidgetOps extends Object
The menu identifier of a bank item option on a RuneLite-shaped (EventBus) client, read from the slot widget's own action list instead of assumed.

Why (Orion, 2026-11-04): Bank used fixed identifiers, and two were wrong. Withdraw-10 sent identifier 7, which is Withdraw-All: the Orion capture of 2026-09-14 records "Withdraw-All" as CC_OP_LOW_PRIORITY id 7, and both tables in Orion's own client jar agree (RuneLite's ShiftWithdrawMode: Withdraw-1 2, -5 3, -10 4, -All 7; unethicalite's Bank.WithdrawOption: ONE 2, FIVE 3, TEN 4, ALL 7). So every withdraw10 (Builder flows, Rule Engine) emptied the stack. Withdraw-1 sent identifier 1, which is "Withdraw-": it withdraws 1 only while the bank's default quantity is 1, and the bench's own Withdraw-All recording first set it to All. Deposit-All sent identifier 2, captured 31 s after that recording had set the default quantity to All, while the jar's ShiftDepositMode puts Deposit-1 at 3 and Deposit-All at 8: identifier 2 is not a fixed Deposit-All.

Orion's bundled unethicalite Bank.withdraw does what this class does: it finds the option by NAME on the slot's actions (Item.getActionIndex) and dispatches that index. An identifier is the action index + 1, and ops above 5 are CC_OP_LOW_PRIORITY (the captured Withdraw-All). When the actions cannot be read the caller refuses: an unreadable menu is not a reason to guess an op.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The actions were read and none is the wanted option.
    static final int
    The slot's actions could not be read (no client, container not loaded, no child at that slot).
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    identifier(String[] actions, String option)
    Pure: index + 1 of the first action equal to option (tags, case and padding ignored), else ABSENT.
    static int
    identifier(net.runelite.api.Client client, int packedContainer, int slot, String option)
    The 1-based menu identifier of option on child slot of packedContainer.
    static net.runelite.api.MenuAction
    menuAction(int identifier)
    RuneLite's convention for widget ops: 1-5 are CC_OP, 6-10 CC_OP_LOW_PRIORITY.

    Methods inherited from class java.lang.Object

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

    • UNREADABLE

      public static final int UNREADABLE
      The slot's actions could not be read (no client, container not loaded, no child at that slot).
      See Also:
    • ABSENT

      public static final int ABSENT
      The actions were read and none is the wanted option.
      See Also:
  • Method Details

    • identifier

      public static int identifier(net.runelite.api.Client client, int packedContainer, int slot, String option)
      The 1-based menu identifier of option on child slot of packedContainer.
    • identifier

      public static int identifier(String[] actions, String option)
      Pure: index + 1 of the first action equal to option (tags, case and padding ignored), else ABSENT.