Class Trade
java.lang.Object
privbot.hooks.Trade
Trade interface state and interaction via
Client and the game client.-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept()Accepts the trade screen that is open (the confirmation screen first).booleanAccepts the first trade screen, the way the client's own Accept click is sent.booleanacceptRequest(String playerName) Accept an INCOMING trade request fromplayerName— the chat link, not the trade screen.booleanAccepts the second trade screen, the way the client's own Accept click is sent.booleandecline()booleanbooleanisOpen()booleanbooleanofferAll(int slot, int itemId) Offers the entire stack in one inventory slot on the first trade screen.booleanOffers a whole stack from the trade screen's inventory, the way the client's own Offer-All click is sent.booleanOffers the first inventory stack matchingname.booleanrequest(PrivPlayer player) Requests a trade withplayer, the way the client's own Trade with click is sent.booleanrequestOption(PrivPlayer player, String optionPrefix, String option) Sends a player right-click option (optionPrefix, e.g.
-
Method Details
-
isFirstScreenOpen
public boolean isFirstScreenOpen()- Returns:
- whether the first trade screen is drawn; false when unreadable
-
isSecondScreenOpen
public boolean isSecondScreenOpen()- Returns:
- whether the confirmation screen is drawn; false when unreadable
-
isOpen
public boolean isOpen()- Returns:
- whether either trade screen is drawn
-
accept
public boolean accept()Accepts the trade screen that is open (the confirmation screen first).- Returns:
- dispatch acceptance; false when no trade screen is open
-
requestOption
Sends a player right-click option (optionPrefix, e.g. "Trade with") on Impact, Elorin and SpawnPK, the way the client's own click on that option is sent; a replayed menu action without the server's option code would be silently dropped. -
acceptRequest
Accept an INCOMING trade request fromplayerName— the chat link, not the trade screen. NeedsTRADE_ACCEPT_REQUEST: on Elorin op 484, whose handler finds the player by the entry's target name and sends the accept packet. -
request
Requests a trade withplayer, the way the client's own Trade with click is sent. -
decline
public boolean decline()- Returns:
- dispatch acceptance of Decline on the first screen; false when it is not open
-
getMyOffer
-
getTheirOffer
-
offerAll
public boolean offerAll(int slot, int itemId) Offers the entire stack in one inventory slot on the first trade screen.Trade options replace the ordinary inventory actions while group 335 is open. Offer-All is the fifth option, so preserving the live slot, inventory widget and item id lets the Impact mapper emit the server's native fifth-inventory-option packet instead of guessing a widget.
-
offerAll
Offers a whole stack from the trade screen's inventory, the way the client's own Offer-All click is sent. -
offerAll
Offers the first inventory stack matchingname. -
acceptFirst
public boolean acceptFirst()Accepts the first trade screen, the way the client's own Accept click is sent. -
acceptSecond
public boolean acceptSecond()Accepts the second trade screen, the way the client's own Accept click is sent.
-