Class GrandExchangeService


  • public class GrandExchangeService
    extends java.lang.Object
    • Constructor Detail

      • GrandExchangeService

        public GrandExchangeService()
    • Method Detail

      • isOpen

        public boolean isOpen()
        Checks if the Grand Exchange interface is currently open.
        Returns:
        true if the Grand Exchange interface is open, false otherwise.
      • isOfferDetailsOpen

        public boolean isOfferDetailsOpen​(int itemId)
        Returns true when an offer details interface is open for a specific item
        Parameters:
        itemId - The item id to check for
        Returns:
        True if the offer details interface is open and false otherwise
      • getFirstFreeSlot

        public GrandExchangeSlot getFirstFreeSlot()
        Attempts to find the first free GE Offer slot. This returns null if no slot could be found
        Returns:
        GrandExchangeSlot the first free slot or null if it cannot be found.
      • collectAll

        public void collectAll()
        Collects all completed offers in the Grand Exchange.
      • collect

        public void collect​(GrandExchangeSlot slot,
                            boolean noted)
        Collects items from a canceled or completed Grand Exchange offer in the specified slot.
        Parameters:
        slot - The GrandExchangeSlot to collect from.
        noted - True to collect noted items, false to collect unnoted items.
      • queueSellOrder

        public GrandExchangeSlot queueSellOrder​(InventoryEntity item,
                                                int amount,
                                                int price)
        Queues a sell offer in the first free Grand Exchange slot.
        Parameters:
        item - The item to sell.
        amount - The amount to sell. Use -1 to sell all available.
        price - The price per item.
        Returns:
        The GrandExchangeSlot object for the GE slot that was used to queue the sell order, or null if no slot is free or an error occurs.
      • queueSellOrder

        public GrandExchangeSlot queueSellOrder​(int itemId,
                                                int amount,
                                                int price)
        Queues a sell offer in the first free Grand Exchange slot. When the amount specified is -1 then all of that item will be sold as part of the offer.
        Parameters:
        itemId - The item id of the item to sell.
        amount - The amount to sell. Use -1 to sell all available.
        price - The price per item.
        Returns:
        The GrandExchangeSlot object for the GE slot that was used to queue the sell order, or null if no slot is free or an error occurs.
      • queueSellOrder

        public GrandExchangeSlot queueSellOrder​(int itemId,
                                                int price)
        Queues a sell offer for all of a specific item in the first free Grand Exchange slot.
        Parameters:
        itemId - The item id to sell
        price - The price to sell the item for.
        Returns:
        The GrandExchangeSlot object for the GE slot that was used to queue the sell order, or null if no slot is free or an error occurs.
      • queueBuyOrder

        public GrandExchangeSlot queueBuyOrder​(int itemId,
                                               int amount,
                                               int price)
        Queues a buy offer in the grand exchange for a given item, the amount of the item to purchase, and a specific price point. Negative amounts are not supported.
        Parameters:
        itemId - The id of the item to purchase
        amount - The amount of the item to purchase
        price - The price the item should be purchased at
        Returns:
        The GrandExchangeSlot object for the GE slot that was used to queue the buy order, or null if no slot is free or an error occurs.
      • queueBuyOrder

        public GrandExchangeSlot queueBuyOrder​(InventoryEntity item,
                                               int amount,
                                               int price)
        Queues a buy offer for all of a specific item in the first free Grand Exchange slot.
        Parameters:
        item - The item to purchase
        amount - The amount of the item to purchase
        price - The price the item should be purchased at
        Returns:
        The GrandExchangeSlot object for the GE slot that was used to queue the buy order, or null if no slot is free or an error occurs.
      • cancelOffer

        public void cancelOffer​(GrandExchangeSlot slot)
        Cancels an active Grand Exchange offer in the specified slot.
        Parameters:
        slot - The GrandExchangeSlot to cancel.