# GrandExchangeOffer Methods to interact with the GrandExchangeOffer interface: ```{figure} ../../images/geo_interface.png ``` The {ref}`GrandExchange` is a very complex interface, probably the most complex available in OldSchool RuneScape and for that reason, the functionality to fully interact with it is split into multiple files and records: - {ref}`GrandExchange`, the main grand exchange screen. - {ref}`GrandExchangeHistory`, the history screen of the grand exchange. - {ref}`GrandExchangeChat`, the chat interface of the grand exchange when you are setting up a buy offer. - {ref}`GrandExchangeOffer`, the screen of the grand exchange where you view or setup a new offer and what this page is about. - - - ## EGEOfferInterface ```pascal EGEOfferInterface = enum(SETUP, STATUS); ``` Enum to represent the type of {ref}`GrandExchange` offer interfaces. There's 2 types of "Offer" interfaces: ```{figure} ../../images/geo_setup.png The "Setup offer" interface. ``` ```{figure} ../../images/geo_status.png The "Status offer" interface. ``` You can differ them by their layout and interface title. - - - ## EGEOfferType ```pascal EGEOfferType = enum(SELL, BUY); ``` Enum to represent the type of Grand Exchange offers. - - - ## EGEOfferSpinButton ```pascal EGEOfferSpinButton = enum(DECREASE, INCREASE); ``` Enum that represents the buttons to decrease/increase the quantity and price spinners of Grand Exchange offers. ```{figure} ../../images/geo_spinners.png ``` - - - ## EGEOfferQuantity ```pascal EGEOfferQuantity = enum(ONE, TEN, HUNDRED, THOUSAND, CUSTOM); ``` Enum that represents the quantity buttons of Grand Exchange offers. ```{figure} ../../images/geo_quantity_buttons.png ``` - - - ## EGEOfferPrice ```pascal EGEOfferPrice = enum(MINUS_CUSTOM, MINUS_FIVE, GUIDE, CUSTOM, PLUS_FIVE, PLUS_CUSTOM); ``` Enum that represents the price buttons of Grand Exchange offers. ```{figure} ../../images/geo_price_buttons.png ``` - - - ## TRSGrandExchangeOffer Record responsible to handle the {ref}`GrandExchangeOffer` interface. - - - ## GrandExchangeOffer.SetupInterface ```pascal procedure TRSGrandExchangeOffer.SetupInterface(); ``` Internal method used to setup the {ref}`TRSGrandExchangeOffer` coordinates. This is automatically called for you on the {ref}`GrandExchangeOffer variable`. - - - ## GrandExchangeOffer.IsOpen ```pascal function TRSGrandExchangeOffer.IsOpen(): Boolean; ``` Returns true if the Grand Exchange is open. Example: ```pascal WriteLn GrandExchangeOffer.IsOpen(); ``` - - - ## GrandExchangeOffer.WaitOpen ```pascal function TRSGrandExchangeOffer.WaitOpen(time: Integer; interval: Integer = -1): Boolean; ``` Returns true if the Grand Exchange is open within `time` milliseconds. ## Example: ```pascal WriteLn GrandExchangeOffer.WaitOpen(); ``` - - - ## GrandExchangeOffer.Close ```pascal function TRSGrandExchangeOffer.Close(escape: Boolean): Boolean; function TRSGrandExchangeOffer.Close(escapeProbability: Single = 0): Boolean; overload; ``` Closes the GrandExchangeOffer, Depending on `escape` or `escapeProbability the function will either click the button or press escape key. Example: ```pascal WriteLn GrandExchangeOffer.Close(); ``` - - - ## GrandExchangeOffer.Open ```pascal function TRSGrandExchangeOffer.Open(): Boolean; ``` Attempts to open the {ref}`GrandExchangeOffer`, returns `True` on success. Example: ```pascal WriteLn GrandExchangeOffer.Open(); ``` - - - ## GrandExchangeOffer.OfferInterface ```pascal property TRSGrandExchangeOffer.OfferInterface: EGEOfferInterface; ``` Returns the {ref}`EGEOfferInterface` type of the {ref}`GrandExchangeOffer` screen. Example: ```pascal WriteLn GrandExchangeOffer.OfferInterface; ``` - - - ## GrandExchangeOffer.OfferType ```pascal property TRSGrandExchangeOffer.OfferType: EGEOfferType; ``` Returns the {ref}`EGEOfferType` of the {ref}`GrandExchangeOffer` screen. ```{figure} ../../images/geo_type.png ``` Example: ```pascal WriteLn GrandExchangeOffer.OfferType; ``` - - - ## GrandExchangeOffer.GuidePrice ```pascal property TRSGrandExchangeOffer.GuidePrice: Integer; ``` Returns the guide price for the item in the {ref}`GrandExchangeOffer` if any. ```{figure} ../../images/geo_guide.png ``` Example: ```pascal WriteLn GrandExchangeOffer.GuidePrice; ``` - - - ## GrandExchangeOffer.Item ```pascal property TRSGrandExchangeOffer.Item: TRSItem; ``` Returns the item in the {ref}`GrandExchangeOffer` if any. ```{figure} ../../images/geo_item.png ``` Example: ```pascal WriteLn GrandExchangeOffer.Item; ``` - - - ## GrandExchangeOffer.Examine ```pascal property TRSGrandExchangeOffer.Examine: String; ``` Returns the examine text of the item in the {ref}`GrandExchangeOffer` if any. ```{figure} ../../images/geo_examine.png ``` Example: ```pascal WriteLn GrandExchangeOffer.Examine; ``` - - - ## GrandExchangeOffer.Fee ```pascal property TRSGrandExchangeOffer.Fee: Double; ``` Returns the fee percentage of the the {ref}`GrandExchangeOffer` if any. This is returned as a `Double`. ```{figure} ../../images/geo_fee.png ``` Example: ```pascal WriteLn GrandExchangeOffer.Fee; ``` - - - ## GrandExchangeOffer.Quantity ```pascal property TRSGrandExchangeOffer.Quantity: Integer; property TRSGrandExchangeOffer.Quantity(value: Integer): Boolean; ``` Returns or sets the quantity of the the {ref}`GrandExchange` offer: ```{figure} ../../images/geo_quantity.png ``` Example: ```pascal WriteLn GrandExchangeOffer.Quantity; WriteLn GrandExchangeOffer.Quantity[100]; WriteLn GrandExchangeOffer.Quantity; ``` - - - ## GrandExchangeOffer.CustomPricePercent ```pascal property TRSGrandExchangeOffer.CustomPricePercent: Double; property TRSGrandExchangeOffer.CustomPricePercent(value: Double): Boolean; ``` Returns or sets the custom price percentage button of the {ref}`GrandExchange` offer: ```{figure} ../../images/geo_customperc.png ``` Example: ```pascal WriteLn GrandExchangeOffer.CustomPricePercent; WriteLn GrandExchangeOffer.CustomPricePercent[0.12]; WriteLn GrandExchangeOffer.CustomPricePercent; ``` - - - ## GrandExchangeOffer.Price ```pascal property TRSGrandExchangeOffer.Price: Integer; property TRSGrandExchangeOffer.Price(value: Integer): Boolean; property TRSGrandExchangeOffer.Price(value: Integer; tolerance: Single): Boolean; ``` Returns or sets the price of the the {ref}`GrandExchange` offer: ```{figure} ../../images/geo_price.png ``` Example: ```pascal WriteLn GrandExchangeOffer.Price; WriteLn GrandExchangeOffer.Price[1500500]; WriteLn GrandExchangeOffer.Price; ``` - - - ## GrandExchangeOffer.Total ```pascal property TRSGrandExchangeOffer.Total: Integer; ``` Returns the total value of the the {ref}`GrandExchange` offer the user will pay/receive: ```{figure} ../../images/geo_total.png ``` This is returned as an `Integer`. Example: ```pascal WriteLn GrandExchangeOffer.Total; ``` - - - ## GrandExchangeOffer.TrueTotal ```pascal property TRSGrandExchangeOffer.TrueTotal: Integer; ``` Returns the true total value of the the {ref}`GrandExchange` offer the user will receive: ```{figure} ../../images/geo_truetotal.png ``` This is returned as an `Integer` and is only available in sell offers. Example: ```pascal WriteLn GrandExchangeOffer.TrueTotal; ``` - - - ## GrandExchangeOffer.Change ```pascal function TRSGrandExchangeOffer.Change(item: TRSItem): Boolean; ``` Attempts to change the offer item to the specified `item`. Example: ```pascal WriteLn GrandExchangeOffer.Change('Abyssal whip'); ``` - - - ## GrandExchangeOffer.Confirm ```pascal function TRSGrandExchangeOffer.Confirm(): Boolean; ``` Attempts to click the confirm button: ```{figure} ../../images/geo_confirm.png ``` Example: ```pascal if GrandExchangeOffer.Change('Abyssal whip') then GrandExchangeOffer.Confirm(); ``` - - - ## GrandExchangeOffer.Back ```pascal function TRSGrandExchangeOffer.Back(): Boolean; ``` Attempts to click the back button: ```{figure} ../../images/geo_back.png ``` Example: ```pascal GrandExchangeOffer.Back(); ``` - - - ## GrandExchangeOffer.HasItems ```pascal function TRSGrandExchangeOffer.HasItems(): Boolean; ``` Checks if we have items to collect in an offer: ```{figure} ../../images/geo_collect.png ``` Example: ```pascal WriteLn GrandExchangeOffer.HasItems(); ``` - - - ## GrandExchangeOffer.Collect ```pascal function TRSGrandExchangeOffer.Collect(): Boolean; ``` Attempts to collect items in an offer. Example: ```pascal GrandExchangeOffer.Collect(); ``` - - - ## GrandExchangeOffer.CreateBuyOffer ```pascal function TRSGrandExchangeOffer.CreateBuyOffer(itemName : String; price, quantity : Integer = -1) : Boolean; ``` Attempts to create a buy offer for the specified `itemName`, `price` and `quantity`. Example: ```pascal if GrandExchangeOffer.CreateBuyOffer('Abyssal whip', 1500000, 1) then WriteLn('Buy offer created successfully!'); ``` - - - ## GrandExchangeOffer.CreateSellOffer ```pascal function TRSGrandExchangeOffer.CreateSellOffer(itemName : String; price, quantity : Integer = -1) : Boolean; ``` Attempts to create a sell offer for the specified `itemName`, `price` and `quantity`. Example: ```pascal if GrandExchangeOffer.CreateSellOffer('Abyssal whip', 1500000, 1) then WriteLn('Sell offer created successfully!'); ``` - - - ## GrandExchangeOffer variable Global {ref}`TRSGrandExchangeOffer` variable.