Interface IGrandExchangeAPI


  • public interface IGrandExchangeAPI
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean backToOverview()
      Clicks the back button on the active/setup offer screen.
      boolean close()  
      boolean close​(boolean useEsc)  
      boolean collectToBank()
      Collects any unclaimed items towards the bank.
      boolean collectToInventory()
      Collects any unclaimed items towards the inventory.
      boolean confirmOffer()
      Confirms the current offer we are setting up on screen.
      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.
      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.
      IGrandExchangeAPI.GrandExchangeScreen getCurrentScreen()  
      GrandExchangeItemDetail getItemDetails​(int id)
      Looks up the item in the official RS Grand Exchange API.
      int getOfferItem()
      Gets the item id of the current offer on screen.
      int getOfferPrice()
      Gets the price per item of the current offer on screen.
      int getOfferQuantity()
      Gets the quantity of the current offer on screen.
      GrandExchangeSlot getSlot​(int slotIndex)
      Get a slot by its index.
      GrandExchangeSlot getSlot​(java.util.function.Predicate<GrandExchangeSlot> filter)
      Get the first slot matching the filter.
      java.util.List<GrandExchangeSlot> getSlots()
      Gets all slots.
      java.util.List<GrandExchangeSlot> getSlots​(java.util.function.Predicate<GrandExchangeSlot> filter)
      Gets all slots matching the filter.
      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.
      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.
      boolean isOpen()  
      boolean newBuyOffer​(GrandExchangeSlot slot, java.lang.String itemName)
      Attempts to start a new buy offer using the given (empty) slot.
      boolean newBuyOffer​(java.lang.String itemName)
      Attempts to start a new buy offer using an empty slot.
      boolean newSellOffer​(int itemId)
      Attempts to start a new sell offer using an empty slot by selling an inventory item with the given id.
      boolean newSellOffer​(ItemWidget item)
      Attempts to start a new sell offer using an empty slot by selling the given item.
      boolean newSellOffer​(java.lang.String itemName)
      Attempts to start a new sell offer using an empty slot by selling an inventory item with the given name.
      boolean open()  
      boolean placeBuyOffer​(java.lang.String itemName, int quantity, int price)
      Convenience method to place a new buy offer using an empty slot.
      boolean placeSellOffer​(int itemId, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      boolean placeSellOffer​(ItemWidget item, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      boolean placeSellOffer​(java.lang.String itemName, int quantity, int price)
      Convenience method to place a new sell offer using an empty slot.
      boolean setPrice​(int price)
      Set the price of the current offer we are setting up on screen.
      boolean setQuantity​(int quantity)
      Set the quantity of the current offer we are setting up on screen.
    • Method Detail

      • 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)
      • 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​(java.lang.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,
                            java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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

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

        java.util.List<GrandExchangeSlot> getSlots​(java.util.function.Predicate<GrandExchangeSlot> filter)
        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

        GrandExchangeSlot getSlot​(java.util.function.Predicate<GrandExchangeSlot> filter)
        Get the first slot matching the filter.
        Parameters:
        filter - match filter
        Returns:
        the slot or null