Package com.epicbot.api.shared.model.ge
Class GrandExchangeSlot
- java.lang.Object
-
- com.epicbot.api.shared.model.ge.GrandExchangeSlot
-
public class GrandExchangeSlot extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GrandExchangeSlot(int index, GrandExchangeOffer offer, APIContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abortOffer()
Aborts the offer from theIGrandExchangeAPI.GrandExchangeScreen.OVERVIEW
screen.boolean
canCollect()
Whether or not the slot has any number of items/coins to collect.int
getIndex()
Gets the slot index.GrandExchangeOffer
getOffer()
Gets the offer.GrandExchangeOffer.OfferState
getState()
Gets the offer state.WidgetChild
getWidget()
Get the slot widget when visible.boolean
inUse()
Whether or not the slot is in use, basically notGrandExchangeOffer.OfferState.EMPTY
.boolean
isCompleted()
Gets whether or not the offer is completed aka checks if the slot state isGrandExchangeOffer.OfferState.BOUGHT
orGrandExchangeOffer.OfferState.SOLD
.boolean
placeBuyOffer(java.lang.String itemName, int quantity, int price)
Places a new buy offer using this (empty) slot.boolean
placeSellOffer(int itemId, int quantity, int price)
Places a new sell offer using this (empty) slot.boolean
placeSellOffer(ItemWidget item, int quantity, int price)
Places a new sell offer using this (empty) slot.boolean
placeSellOffer(java.lang.String itemName, int quantity, int price)
Places a new sell offer using this (empty) slot.java.lang.String
toString()
boolean
viewOffer()
Views the offer from theIGrandExchangeAPI.GrandExchangeScreen.OVERVIEW
screen.
-
-
-
Constructor Detail
-
GrandExchangeSlot
public GrandExchangeSlot(int index, GrandExchangeOffer offer, APIContext ctx)
-
-
Method Detail
-
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 notGrandExchangeOffer.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 isGrandExchangeOffer.OfferState.BOUGHT
orGrandExchangeOffer.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 theIGrandExchangeAPI.GrandExchangeScreen.OVERVIEW
screen.- Returns:
- true if successful, false otherwise
-
abortOffer
public boolean abortOffer()
Aborts the offer from theIGrandExchangeAPI.GrandExchangeScreen.OVERVIEW
screen.- Returns:
- true if successful, false otherwise
-
placeBuyOffer
public boolean placeBuyOffer(java.lang.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 boughtprice
- 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 idquantity
- number of items to be boughtprice
- price per item, -1 to leave price at guide price- Returns:
- true if an offer is placed successfully, false otherwise
-
placeSellOffer
public boolean placeSellOffer(java.lang.String itemName, int quantity, int price)
Places a new sell offer using this (empty) slot.- Parameters:
itemName
- the item namequantity
- number of items to be boughtprice
- 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 itemquantity
- number of items to be boughtprice
- 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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-