Package rsb.methods

Class GrandExchange

java.lang.Object
rsb.methods.MethodProvider
rsb.methods.GrandExchange

public class GrandExchange extends MethodProvider
Obtains information on tradeable items from the Grand Exchange website and Grand Exchange ingame interaction.
Author:
GigiaJ
  • Field Summary

    Fields inherited from class rsb.methods.MethodProvider

    methods
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    buy(int id, int quantity, int priceChange, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    buy(String name, int quantity, int priceChange, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    buyItem(int id, int quantity, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    buyItem(int id, int quantity, int priceChange)
    Buys an item from the grand exchange
    boolean
    buyItem(int id, int quantity, int priceChange, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    buyItem(String name, int quantity, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    buyItem(String name, int quantity, int priceChange)
    Buys an item from the grand exchange
    boolean
    buyItem(String name, int quantity, int priceChange, boolean roundQuantity)
    Buys an item from the grand exchange
    boolean
    checkCompleted(int slot)
    Will check a slot for to see if an item has completed.
    checkSlot(int slot)
    Checks Grand Exchange slot and returns name
    boolean
    checkSlotIsEmpty(int slot)
    Checks Grand Exchange slots for an any activity (1-8)
    boolean
    checkSlotLocked(int slot)
    Checks if the Grand Exchange slot is locked or not
    boolean
     
    void
    collect(boolean asNote)
    A method to collect items from a slot as note or as the item itself
    void
    collectItem(int slot)
    Gets any item that is in the offer as the item and to the inventory
    void
    collectItem(int slot, boolean asNote)
    Gets any item that is in the offer as the item and in the form designated
    void
    collectItem(int slot, boolean toBank, boolean asNote)
    Gets any items that may be in the offer.
    boolean
    createOffer(int quantity, int priceChange)
    Creates an offer based on the parameters given
    int
    Checks Grand Exchange slots for an item.
    int
    Finds first empty slot.
    boolean
    Checks if Grand Exchange is open.
    boolean
    Opens Grand Exchange window.
    boolean
    sell(int id, int quantity, int priceChange, boolean roundQuantity)
    Sells an item in the grand exchange
    boolean
    sell(String name, int quantity, int priceChange, boolean roundQuantity)
    Sells an item in the grand exchange
    boolean
    sellItem(int id, int quantity)
    Sells an item in the grand exchange
    boolean
    sellItem(int id, int quantity, boolean roundQuantity)
    Sells an item in the grand exchange
    boolean
    sellItem(int id, int quantity, int priceChange)
    Sells an item in the grand exchange
    boolean
    sellItem(int id, int quantity, int priceChange, boolean roundQuantity)
    Sells an item in the grand exchange
    boolean
    sellItem(String name, int quantity)
    Sells an item in the grand exchange
    boolean
    sellItem(String name, int quantity, boolean roundQuantity)
    Sells an item in the grand exchange
    boolean
    sellItem(String name, int quantity, int priceChange)
    Sells an item in the grand exchange
    boolean
    sellItem(String name, int quantity, int priceChange, boolean roundQuantity)
    Sells an item in the grand exchange
    void
    setPrice(int priceChange)
    Decides how many times to press the respective button to set the price per item (-5% or +5%)
    void
    setQuantity(int quantity)
    Sets the quantity of items in the offer interface randomizing how it goes about doing so too

    Methods inherited from class rsb.methods.MethodProvider

    random, random, random, random, sleep

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isOpen

      public boolean isOpen()
      Checks if Grand Exchange is open.
      Returns:
      True if it's open, otherwise false.
    • open

      public boolean open()
      Opens Grand Exchange window.
      Returns:
      True if it's open, otherwise false.
    • close

      public boolean close()
    • checkSlotIsEmpty

      public boolean checkSlotIsEmpty(int slot)
      Checks Grand Exchange slots for an any activity (1-8)
      Parameters:
      slot - An int for the corresponding slot.
      Returns:
      True if the slot is free from activity.
    • checkSlotLocked

      public boolean checkSlotLocked(int slot)
      Checks if the Grand Exchange slot is locked or not
      Parameters:
      slot - An int for the corresponding slot.
      Returns:
      True if the user is a member else false for slots 4-8
    • checkSlot

      public String checkSlot(int slot)
      Checks Grand Exchange slot and returns name
      Parameters:
      slot - The slot to check
      Returns:
      The item name as a string equal to the item being sold/brought Will return null if no items are being sold.
    • findItem

      public int findItem(String name)
      Checks Grand Exchange slots for an item.
      Parameters:
      name - The name of the item to check for.
      Returns:
      An int of the corresponding slot. 0 = Not found.
    • freeSlot

      public int freeSlot()
      Finds first empty slot.
      Returns:
      An int of the corresponding slot. 0 = No empty slots.
    • checkCompleted

      public boolean checkCompleted(int slot)
      Will check a slot for to see if an item has completed.
      Parameters:
      slot - The slot to check.
      Returns:
      true if Complete, otherwise false
    • collect

      public void collect(boolean asNote)
      A method to collect items from a slot as note or as the item itself
      Parameters:
      asNote - whether the item should be withdrawn as a note
    • collectItem

      public void collectItem(int slot)
      Gets any item that is in the offer as the item and to the inventory
      Parameters:
      slot - An int for the corresponding slot, of which to check
    • collectItem

      public void collectItem(int slot, boolean asNote)
      Gets any item that is in the offer as the item and in the form designated
      Parameters:
      slot - An int for the corresponding slot, of which to check
      asNote - whether the item should be withdrawn as a note
    • collectItem

      public void collectItem(int slot, boolean toBank, boolean asNote)
      Gets any items that may be in the offer.
      Parameters:
      slot - An int for the corresponding slot, of which to check
      toBank - whether the item should be sent to the bank
      asNote - whether the item should be withdrawn as a note
    • createOffer

      public boolean createOffer(int quantity, int priceChange)
      Creates an offer based on the parameters given
      Parameters:
      quantity - the number of items to list for
      priceChange - the number of times to press the price per item +5% or -5% buttons
      Returns:
      true if the offer was attempted to be made; otherwise false
    • setPrice

      public void setPrice(int priceChange)
      Decides how many times to press the respective button to set the price per item (-5% or +5%)
      Parameters:
      priceChange - the number of button presses
    • setQuantity

      public void setQuantity(int quantity)
      Sets the quantity of items in the offer interface randomizing how it goes about doing so too
      Parameters:
      quantity - the quantity to list
    • buy

      public boolean buy(int id, int quantity, int priceChange, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • buy

      public boolean buy(String name, int quantity, int priceChange, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(String name, int quantity, int priceChange)
      Buys an item from the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(String name, int quantity, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(String name, int quantity, int priceChange, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(int id, int quantity, int priceChange)
      Buys an item from the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(int id, int quantity, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • buyItem

      public boolean buyItem(int id, int quantity, int priceChange, boolean roundQuantity)
      Buys an item from the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sell

      public boolean sell(int id, int quantity, int priceChange, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sell

      public boolean sell(String name, int quantity, int priceChange, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(String name, int quantity, int priceChange, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(String name, int quantity, int priceChange)
      Sells an item in the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(String name, int quantity, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(String name, int quantity)
      Sells an item in the grand exchange
      Parameters:
      name - the name of the item
      quantity - the number of items to buy
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(int id, int quantity, int priceChange, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(int id, int quantity, int priceChange)
      Sells an item in the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      priceChange - the number of times to press the price change buttons (-5% or +5%)
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(int id, int quantity, boolean roundQuantity)
      Sells an item in the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      roundQuantity - decides whether we need exactly this amount or not
      Returns:
      True unless we can't buy
    • sellItem

      public boolean sellItem(int id, int quantity)
      Sells an item in the grand exchange
      Parameters:
      id - the id of the item
      quantity - the number of items to buy
      Returns:
      True unless we can't buy