# GrandExchangeChat Methods to interact with the GrandExchangeChat interface: ```{figure} ../../images/gec_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 and what this page is about. - {ref}`GrandExchangeOffer`, the screen of the grand exchange where you view or setup a new offer. - - - ## TRSGrandExchangeChat Record responsible to handle the {ref}`GrandExchangeChat` interface. - - - ## GrandExchangeChat.Grid ```pascal property TRSGrandExchangeChat.Grid: TBoxArray; ``` Returns the {ref}`GrandExchangeChat` search grid. Example: ```pascal {$I WaspLib/osrs.simba} begin while True do ShowOnTarget(GrandExchangeChat.Grid); end. ``` ```{figure} ../../images/gec_grid.gif ``` - - - ## GrandExchangeChat.SetupInterface ```pascal procedure TRSGrandExchangeChat.SetupInterface(); ``` Internal method used to setup the {ref}`TRSGrandExchangeChat` coordinates. This is automatically called for you on the {ref}`GrandExchangeChat variable`. - - - ## GrandExchangeChat.IsOpen ```pascal function TRSGrandExchangeChat.IsOpen(): Boolean; ``` Returns true if the Grand Exchange is open. Example: ```pascal WriteLn GrandExchangeChat.IsOpen(); ``` - - - ## GrandExchangeChat.WaitOpen ```pascal function TRSGrandExchangeChat.WaitOpen(time: Integer; interval: Integer = -1): Boolean; ``` Returns true if the Grand Exchange is open within `time` milliseconds. ## Example: ```pascal WriteLn GrandExchangeChat.WaitOpen(); ``` - - - ## GrandExchangeChat.SearchText ```pascal property TRSGrandExchangeChat.SearchText: String; property TRSGrandExchangeChat.SearchText(search: String): Boolean; ``` Returns the current {ref}`GrandExchangeChat` search or updates it. ```{figure} ../../images/gec_search.png ``` Example: ```pascal WriteLn GrandExchangeChat.SearchText; WriteLn GrandExchangeChat.SearchText['Bandos tassets']; WriteLn GrandExchangeChat.SearchText; WriteLn GrandExchangeChat.SearchText['Bandos chestplate']; WriteLn GrandExchangeChat.SearchText; WriteLn GrandExchangeChat.SearchText['Banana']; WriteLn GrandExchangeChat.SearchText; ``` - - - ## GrandExchangeChat.Find ```pascal function TRSGrandExchangeChat.Find(item: TRSItem; out bounds: TBox): Boolean; ``` Returns true if the specified `item` text is found on the {ref}`GrandExchangeChat.Grid`. `bounds` will return the grid box where the item text was found. Example: ```pascal {$I WaspLib/osrs.simba} var b: TBox; begin if GrandExchangeChat.Find('Abyssal whip', b) then ShowOnTarget(b); end. ``` ```{figure} ../../images/gec_Find.png ``` - - - ## GrandExchangeChat.Contains ```pascal function TRSGrandExchangeChat.Contains(item: TRSItem): Boolean; ``` Returns true if the specified `item` text is found on the {ref}`GrandExchangeChat.Grid`. Example: ```pascal WriteLn GrandExchangeChat.Contains('Abyssal whip'); ``` - - - ## GrandExchangeChat.Click ```pascal function TRSGrandExchangeChat.Click(item: TRSItem): Boolean; ``` Attempts to click the specified `item` on the {ref}`GrandExchangeChat.Grid`. Example: ```pascal WriteLn GrandExchangeChat.Click('Abyssal whip'); ``` - - - ## GrandExchangeChat.FindScroll ```pascal function TRSGrandExchangeChat.FindScroll(item: TRSItem): Integer; ``` Attempts to find the scroll level the specified `item` is found on the {ref}`GrandExchangeChat.Grid`. Example: ```pascal WriteLn GrandExchangeChat.FindScroll('Bandos tassets'); ``` - - - ## GrandExchangeChat.ScrollTo ```pascal function TRSGrandExchangeChat.ScrollTo(item: TRSItem): Boolean; ``` Attempts to scroll until the specified `item` is found on the {ref}`GrandExchangeChat.Grid`. Example: ```pascal WriteLn GrandExchangeChat.ScrollTo('Bandos tassets'); ``` - - - ## GrandExchangeChat variable Global {ref}`TRSGrandExchangeChat` variable.