public class Trade extends API
Modifier and Type | Class and Description |
---|---|
static class |
Trade.OfferOwner
The owner of an offer.
|
static class |
Trade.OurOffer |
static class |
Trade.RequestListener |
static class |
Trade.TheirOffer |
Modifier and Type | Field and Description |
---|---|
static int |
FIRST_INTERFACE_ID |
static int |
OFFER_1 |
static int |
OFFER_10 |
static int |
OFFER_5 |
static int |
OFFER_ALL |
static int |
OUR_ITEM_CONTAINER_WIDGET |
static int |
REMOVE_1 |
static int |
REMOVE_10 |
static int |
REMOVE_5 |
static int |
REMOVE_ALL |
static int |
REQUEST_TIMEOUT |
static int |
SECOND_INTERFACE_ID |
static int |
THEIR_ITEM_CONTAINER_WIDGET |
bank, bot, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
Trade() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptTrade()
Accepts any current trade and cached items to verify the trade using
Trade.verifyTrade() |
boolean |
declineTrade()
Declines any current trades.
|
boolean |
didOtherAcceptTrade()
Determines if the other player has accepted.
|
Player |
getLastRequestingPlayer()
Gets the last trade requesting player.
|
java.lang.String |
getOtherPlayer()
If we're currently trading, this method will return the other player.
|
Trade.OurOffer |
getOurOffers()
Gets the container for our player's offers.
|
Trade.RequestListener |
getRequestListener()
Gets the request listener for the trade API.
|
java.awt.Rectangle |
getSlotBoundingBox(Trade.OfferOwner owner,
int slot)
Gets the bounding box for the given item slot
|
Trade.TheirOffer |
getTheirOffers()
Gets the container for the other player's offers.
|
boolean |
hover(int slot)
Hovers with the slot specified.
|
void |
initializeModule() |
boolean |
interact(int slot,
java.lang.String... actions)
Interacts with the slot specified.
|
boolean |
isCurrentlyTrading()
Determines if we're currently trading.
|
boolean |
isFirstInterfaceOpen()
Determines if we're on the first trading window.
|
boolean |
isSecondInterfaceOpen()
Deterines if we're on the second trading window.
|
boolean |
offer(int id,
int amount)
Offers specified item with the specified amount in the trade screen.
|
boolean |
offer(java.lang.String name,
int amount)
Offers the specified item with the specified amount in the trade screen.
|
boolean |
offerAll(Filter<Item>... filters)
Offers all the items in the filter in the trade screen.
|
boolean |
offerAll(int... ids)
Offers all the items in the filter in the trade screen.
|
boolean |
offerAll(java.util.List<Item> items)
Offers all the items in the filter in the trade screen.
|
boolean |
offerAll(java.lang.String... names)
Offers all the items in the filter in the trade screen.
|
boolean |
offerAllExcept(Filter<Item>... filters)
Offers all the items in the inventory excluding the items in the
filters passed.
|
boolean |
offerAllExcept(int... ids)
Offers all the items in the inventory excluding items with the specified ids.
|
boolean |
offerAllExcept(java.util.List<Item> items)
Offers all the items in the inventory excluding the specified list of items
passed.
|
boolean |
offerAllExcept(java.lang.String... names)
Offers all the items in the inventory excluding items with the specified names.
|
boolean |
remove(Filter<Item> filter,
int amount_)
Removes the specified items with the specified amounts from the trade screen.
|
boolean |
remove(java.util.HashMap<java.lang.String,java.lang.Integer> items)
REmoves all items in the HashMap.
|
boolean |
remove(int id,
int amount)
Removes an item with the specified amount.
|
boolean |
remove(java.lang.String name,
int amount)
Removes an item with the specified amount..
|
boolean |
removeAll(Filter<Item> filter)
Removes all of the specified items.
|
boolean |
removeAll(int id)
Removes all of the specified items.
|
boolean |
removeAll(java.lang.String name)
Removes all of the specified items.
|
exchangeContext, execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public static final int REQUEST_TIMEOUT
public static final int FIRST_INTERFACE_ID
public static final int SECOND_INTERFACE_ID
public static final int OUR_ITEM_CONTAINER_WIDGET
public static final int THEIR_ITEM_CONTAINER_WIDGET
public static final int OFFER_ALL
public static final int OFFER_1
public static final int OFFER_5
public static final int OFFER_10
public static final int REMOVE_ALL
public static final int REMOVE_1
public static final int REMOVE_5
public static final int REMOVE_10
public boolean interact(int slot, java.lang.String... actions)
slot
- The slot to interact with.actions
- The action to interact with.public boolean hover(int slot)
slot
- The slot to hover.public boolean offer(int id, int amount)
id
- The item id.amount
- The amount to offer. OFFER_ALL
or 0 defines the
option Offer-All.public boolean offer(java.lang.String name, int amount)
name
- The item name.amount
- The amount to offer. OFFER_ALL
or 0 defines the
option Offer-All.public boolean offerAll(int... ids)
ids
- The ids of the items to be offered.public boolean offerAll(java.lang.String... names)
names
- The ids of the items to be offered.public boolean offerAll(java.util.List<Item> items)
items
- The ids of the items to be offered in the bank.@SafeVarargs public final boolean offerAll(Filter<Item>... filters)
filters
- The filter.public boolean offerAllExcept(int... ids)
ids
- Item ids to ignore when offering.public boolean offerAllExcept(java.lang.String... names)
names
- Item names to ignore when offering.public boolean offerAllExcept(java.util.List<Item> items)
items
- The list.@SafeVarargs public final boolean offerAllExcept(Filter<Item>... filters)
filters
- The filters.public boolean remove(Filter<Item> filter, int amount_)
filter
- The filter.amount_
- The amount to remove. REMOVE_ALL
or 0 defines
the option Remove-All.public boolean removeAll(int id)
id
- The item id.public boolean removeAll(java.lang.String name)
name
- The item name.public boolean removeAll(Filter<Item> filter)
filter
- The item filter.public boolean remove(int id, int amount)
id
- The item id.amount
- The amount to remove.public boolean remove(java.lang.String name, int amount)
name
- The item name.amount
- The amount to remove.public boolean remove(java.util.HashMap<java.lang.String,java.lang.Integer> items)
public void initializeModule()
initializeModule
in class API
public boolean isCurrentlyTrading()
public boolean isFirstInterfaceOpen()
public boolean isSecondInterfaceOpen()
public Trade.OurOffer getOurOffers()
Do not use this if no trade window is open.
ItemContainer
public Trade.TheirOffer getTheirOffers()
Do not use this if no trade window is open.
ItemContainer
public Trade.RequestListener getRequestListener()
Trade.RequestListener.getRequests()
public java.lang.String getOtherPlayer()
public Player getLastRequestingPlayer()
public boolean acceptTrade()
Trade.verifyTrade()
public boolean declineTrade()
public boolean didOtherAcceptTrade()
public java.awt.Rectangle getSlotBoundingBox(Trade.OfferOwner owner, int slot)
slot
- The slot to get the bounding box of