Interface IGrandExchangeAPI


public interface IGrandExchangeAPI
  • Method Details

    • getItemDetails

      GrandExchangeItemDetail getItemDetails(int id)
      Looks up the item in the official RS Grand Exchange API.
      Parameters:
      id - the item id
      Returns:
      item detail or null
    • isOpen

      boolean isOpen()
    • open

      boolean open()
    • close

      boolean close()
    • close

      boolean close(boolean useEsc)
    • getCurrentScreen

    • collectToBank

      boolean collectToBank()
      Collects any unclaimed items towards the bank.
      Returns:
      true if successful, false otherwise
    • collectToInventory

      boolean collectToInventory()
      Collects any unclaimed items towards the inventory.
      Returns:
      true if successful, false otherwise
    • backToOverview

      boolean backToOverview()
      Clicks the back button on the active/setup offer screen.
      Returns:
      true if successful, false otherwise
    • increasePriceBy5Percent

      boolean increasePriceBy5Percent()
      Clicks the increase +5% button to increase the current price per item by 5% of the current offer we are setting up on screen.
      Returns:
      true if successful, false otherwise
    • increasePriceBy5Percent

      boolean increasePriceBy5Percent(int times)
      Clicks the increase +5% button to increase the current price per item by 5% of the current offer we are setting up on screen.
      Parameters:
      times - number of times to click the button
      Returns:
      true if successful, false otherwise
    • decreasePriceBy5Percent

      boolean decreasePriceBy5Percent()
      Clicks the decrease +5% button to decrease the current price per item by 5% of the current offer we are setting up on screen.
      Returns:
      true if successful, false otherwise
    • decreasePriceBy5Percent

      boolean decreasePriceBy5Percent(int times)
      Clicks the decrease +5% button to decrease the current price per item by 5% of the current offer we are setting up on screen.
      Parameters:
      times - number of times to click the button
      Returns:
      true if successful, false otherwise
    • newBuyOffer

      boolean newBuyOffer(int itemId)
      Attempts to start a new buy offer using an empty slot.
      Parameters:
      itemId - the item id
      Returns:
      true if successful, false otherwise
    • newBuyOffer

      boolean newBuyOffer(GrandExchangeSlot slot, int itemId)
      Attempts to start a new buy offer using the given (empty) slot.
      Parameters:
      slot - the empty slot
      itemId - the item id
      Returns:
      true if successful, false otherwise
    • newBuyOffer

      boolean newBuyOffer(String itemName)
      Attempts to start a new buy offer using an empty slot.
      Parameters:
      itemName - the exact item name (KeyEvent.VK_ENTER is pressed after search)
      Returns:
      true if successful, false otherwise
    • newBuyOffer

      boolean newBuyOffer(GrandExchangeSlot slot, String itemName)
      Attempts to start a new buy offer using the given (empty) slot.
      Parameters:
      slot - the empty slot
      itemName - the exact item name (KeyEvent.VK_ENTER is pressed after search)
      Returns:
      true if successful, false otherwise
    • newSellOffer

      boolean newSellOffer(int itemId)
      Attempts to start a new sell offer using an empty slot by selling an inventory item with the given id.
      Parameters:
      itemId - the item id
      Returns:
      true if successful, false otherwise
    • newSellOffer

      boolean newSellOffer(String itemName)
      Attempts to start a new sell offer using an empty slot by selling an inventory item with the given name.
      Parameters:
      itemName - the item name
      Returns:
      true if successful, false otherwise
    • newSellOffer

      boolean newSellOffer(ItemWidget item)
      Attempts to start a new sell offer using an empty slot by selling the given item.
      Parameters:
      item - the item
      Returns:
      true if successful, false otherwise
    • setQuantity

      boolean setQuantity(int quantity)
      Set the quantity of the current offer we are setting up on screen.
      Parameters:
      quantity - the quantity
      Returns:
      true if successful, false otherwise
    • setPrice

      boolean setPrice(int price)
      Set the price of the current offer we are setting up on screen.
      Parameters:
      price - the price
      Returns:
      true if successful, false otherwise
    • confirmOffer

      boolean confirmOffer()
      Confirms the current offer we are setting up on screen.
      Returns:
      true if successful, false otherwise
    • getOfferItem

      int getOfferItem()
      Gets the item id of the current offer on screen.
      Returns:
      int
    • getOfferQuantity

      int getOfferQuantity()
      Gets the quantity of the current offer on screen.
      Returns:
      int
    • getOfferPrice

      int getOfferPrice()
      Gets the price per item of the current offer on screen.
      Returns:
      int
    • placeBuyOffer

      boolean placeBuyOffer(int itemId, int quantity, int price)
      Convenience method to place a new buy offer using an empty slot.
      Parameters:
      itemId - the item id
      quantity - number of items to be bought
      price - price per item, -1 to leave price at guide price
      Returns:
      true if an offer is placed successfully, false otherwise
    • placeBuyOffer

      boolean placeBuyOffer(String itemName, int quantity, int price)
      Convenience method to place a new buy offer using an empty slot.
      Parameters:
      itemName - the exact item name (KeyEvent.VK_ENTER is pressed after search)
      quantity - number of items to be bought
      price - price per item, -1 to leave price at guide price
      Returns:
      true if an offer is placed successfully, false otherwise
    • placeSellOffer

      boolean placeSellOffer(int itemId, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      Parameters:
      itemId - the item id
      quantity - number of items to be bought
      price - price per item, -1 to leave price at guide price
      Returns:
      true if an offer is placed successfully, false otherwise
    • placeSellOffer

      boolean placeSellOffer(String itemName, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      Parameters:
      itemName - the item name
      quantity - number of items to be bought
      price - price per item, -1 to leave price at guide price
      Returns:
      true if an offer is placed successfully, false otherwise
    • placeSellOffer

      boolean placeSellOffer(ItemWidget item, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      Parameters:
      item - the item
      quantity - number of items to be bought
      price - price per item, -1 to leave price at guide price
      Returns:
      true if an offer is placed successfully, false otherwise
    • getSlots

      List<GrandExchangeSlot> getSlots()
      Gets all slots.
      Returns:
      list of slots
    • getSlots

      Gets all slots matching the filter.
      Parameters:
      filter - match filter
      Returns:
      list of slots
    • getSlot

      GrandExchangeSlot getSlot(int slotIndex)
      Get a slot by its index.
      Parameters:
      slotIndex - the slot index 0-7
      Returns:
      the slot
    • getSlot

      Get the first slot matching the filter.
      Parameters:
      filter - match filter
      Returns:
      the slot or null