Skip to main content

Shop Actions

ShopActions wraps NPC shop interactions, supporting multi-quantity purchases by item ID or display name.

Action Methods

All buy methods accept either int itemId or String name (case-insensitive, partial match). All return InteractionResult.

  • buyOne(int/String) - buys 1
  • buyFive(int/String) - buys 5
  • buyTen(int/String) - buys 10
  • buyFifty(int/String) - buys 50

Example:

InteractionResult result = ShopActions.buyTen(1219);
if (result.getStatus() == InteractionStatus.PACED) {
return; // retry next tick
}

Or by name:

ShopActions.buyFifty("Bronze arrow");

Behavior notes:

  • SHOP_NOT_OPEN is returned by any action when isOpen() is false.
  • SHOP_ITEM_NOT_FOUND is returned when no stock widget matches the ID or name.
  • All buys are paced through ActionPacer; PACED is returned during the cooldown window.
  • Purchases delegate to ShopInteraction.buyOne/Five/Ten/Fifty - the underlying packet dispatch is handled there.

Read shop-open state, stock, and visible items through ShopApi and sdk.query.Shop; see Query Helpers. The action class uses those reads internally only to guard a purchase.