Class GrandExchangeSlot

java.lang.Object
com.epicbot.api.shared.model.ge.GrandExchangeSlot

public class GrandExchangeSlot extends Object
  • Constructor Details

  • Method Details

    • getIndex

      public int getIndex()
      Gets the slot index.
      Returns:
      int
    • getState

      public GrandExchangeOffer.OfferState getState()
      Gets the offer state.
      Returns:
      GrandExchangeOffer.OfferState
    • inUse

      public boolean inUse()
      Whether or not the slot is in use, basically not GrandExchangeOffer.OfferState.EMPTY.
      Returns:
      true if in use, false otherwise
    • isCompleted

      public boolean isCompleted()
      Gets whether or not the offer is completed aka checks if the slot state is GrandExchangeOffer.OfferState.BOUGHT or GrandExchangeOffer.OfferState.SOLD.
      Returns:
      true if completed, false otherwise
    • canCollect

      public boolean canCollect()
      Whether or not the slot has any number of items/coins to collect. True for the following cases:
      Returns:
      true if items/coins can be collected, false otherwise
    • getOffer

      public GrandExchangeOffer getOffer()
      Gets the offer.
      Returns:
      the offer.
    • viewOffer

      public boolean viewOffer()
      Views the offer from the IGrandExchangeAPI.GrandExchangeScreen.OVERVIEW screen.
      Returns:
      true if successful, false otherwise
    • abortOffer

      public boolean abortOffer()
      Aborts the offer from the IGrandExchangeAPI.GrandExchangeScreen.OVERVIEW screen.
      Returns:
      true if successful, false otherwise
    • placeBuyOffer

      public boolean placeBuyOffer(int itemId, int quantity, int price)
      Places a new buy offer using this (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

      public boolean placeBuyOffer(String itemName, int quantity, int price)
      Places a new buy offer using this (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

      public boolean placeSellOffer(int itemId, int quantity, int price)
      Places a new sell offer using this (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

      public boolean placeSellOffer(String itemName, int quantity, int price)
      Places a new sell offer using this (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

      public boolean placeSellOffer(ItemWidget item, int quantity, int price)
      Places a new sell offer using this (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
    • getWidget

      public WidgetChild getWidget()
      Get the slot widget when visible.
      Returns:
      the widget or null when the grand exchange widget (WidgetID.BANK_GROUP_ID) is not visible.
    • toString

      public String toString()
      Overrides:
      toString in class Object