Class GrandExchangeService


  • @Singleton
    public class GrandExchangeService
    extends java.lang.Object
    Grand Exchange slot readback and visible offer commands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort​(int zeroBasedSlot)
      Aborts an active offer in the specified slot.
      void adjustPrice​(PriceAdjustment adjustment)
      Adjusts the price using one of the native shortcut buttons (+1, -1, +5%, -5%, Guide price).
      void adjustQuantity​(QuantityAdjustment adjustment)
      Adjusts the quantity using one of the native shortcut buttons (+1, -1, +10, +100, +1000, All).
      void cancelSelected()  
      boolean close()
      Closes the Grand Exchange interface.
      void collect​(int zeroBasedSlot)  
      void collectAll()  
      void collectSelected()  
      void collectSlot​(int zeroBasedSlot)
      Collects one completed offer when the global collect control is unavailable.
      void confirm()  
      boolean goBack()
      Returns from the offer setup or detail view back to the main offers overview.
      boolean isOpen()  
      boolean isSearching()
      True if the chatbox item search prompt is currently active.
      GrandExchangeSlot offer​(int slot)  
      java.util.List<GrandExchangeSlot> offers()  
      boolean open()
      Automatically discovers the nearest Grand Exchange clerk or booth and opens the exchange.
      void open​(NpcRef clerk)
      Opens the Grand Exchange via the specified clerk NPC.
      boolean openOfferDetails​(int zeroBasedSlot)
      Opens the details screen for an active offer slot.
      void openPriceEntry()
      Opens the price input; submit the value on a later client tick.
      void openQuantityEntry()
      Opens the quantity input; submit the value on a later client tick.
      void openSlot​(int zeroBasedSlot, boolean buy)  
      boolean retryOfferWithHigherPrice​(int zeroBasedSlot, PriceAdjustment adjustment)
      Aborts an active buying offer that has not yet filled, collects returned coins, re-opens the slot, bumps the price higher using the specified adjustment, and confirms the new offer.
      java.util.List<SearchResult> searchResults()
      The items listed under the search prompt, in the order shown.
      boolean selectBuyItem​(int itemId)
      Selects an item from the search results by item ID, scrolling the list to it if needed.
      boolean selectBuyItem​(java.lang.String itemName)
      Selects an item from the search results by name.
      void selectSellItem​(InventoryItem item)  
      void setPrice​(int price)  
      void setQuantity​(int quantity)  
      void submitPrice​(int price)
      Sends the active price input value.
      void submitQuantity​(int quantity)
      Sends the active quantity input value.
      void typeSearch​(java.lang.String query)
      Simulates typing search text into the active chatbox search prompt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isOpen

        public boolean isOpen()
      • open

        public void open​(NpcRef clerk)
        Opens the Grand Exchange via the specified clerk NPC.
      • open

        public boolean open()
        Automatically discovers the nearest Grand Exchange clerk or booth and opens the exchange.
      • close

        public boolean close()
        Closes the Grand Exchange interface.
      • goBack

        public boolean goBack()
        Returns from the offer setup or detail view back to the main offers overview.
      • isSearching

        public boolean isSearching()
        True if the chatbox item search prompt is currently active.
      • typeSearch

        public void typeSearch​(java.lang.String query)
        Simulates typing search text into the active chatbox search prompt.
      • searchResults

        public java.util.List<SearchResult> searchResults()
        The items listed under the search prompt, in the order shown.
      • selectBuyItem

        public boolean selectBuyItem​(int itemId)
        Selects an item from the search results by item ID, scrolling the list to it if needed.
      • selectBuyItem

        public boolean selectBuyItem​(java.lang.String itemName)
        Selects an item from the search results by name. An exact match wins over a partial one, so "Rune platebody" is not mistaken for "Rune platebody (g)".
      • openSlot

        public void openSlot​(int zeroBasedSlot,
                             boolean buy)
      • selectSellItem

        public void selectSellItem​(InventoryItem item)
      • setQuantity

        public void setQuantity​(int quantity)
      • openPriceEntry

        public void openPriceEntry()
        Opens the price input; submit the value on a later client tick.
      • submitPrice

        public void submitPrice​(int price)
        Sends the active price input value.
      • openQuantityEntry

        public void openQuantityEntry()
        Opens the quantity input; submit the value on a later client tick.
      • submitQuantity

        public void submitQuantity​(int quantity)
        Sends the active quantity input value.
      • setPrice

        public void setPrice​(int price)
      • adjustPrice

        public void adjustPrice​(PriceAdjustment adjustment)
        Adjusts the price using one of the native shortcut buttons (+1, -1, +5%, -5%, Guide price).
      • adjustQuantity

        public void adjustQuantity​(QuantityAdjustment adjustment)
        Adjusts the quantity using one of the native shortcut buttons (+1, -1, +10, +100, +1000, All).
      • confirm

        public void confirm()
      • collectAll

        public void collectAll()
      • collectSlot

        public void collectSlot​(int zeroBasedSlot)
        Collects one completed offer when the global collect control is unavailable.
      • collect

        public void collect​(int zeroBasedSlot)
      • collectSelected

        public void collectSelected()
      • cancelSelected

        public void cancelSelected()
      • abort

        public void abort​(int zeroBasedSlot)
        Aborts an active offer in the specified slot.
      • openOfferDetails

        public boolean openOfferDetails​(int zeroBasedSlot)
        Opens the details screen for an active offer slot.
      • retryOfferWithHigherPrice

        public boolean retryOfferWithHigherPrice​(int zeroBasedSlot,
                                                 PriceAdjustment adjustment)
        Aborts an active buying offer that has not yet filled, collects returned coins, re-opens the slot, bumps the price higher using the specified adjustment, and confirms the new offer.