GrandExchangeChat

Methods to interact with the GrandExchangeChat interface:

_images/gec_interface.png

The 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:


TRSGrandExchangeChat

Record responsible to handle the GrandExchangeChat interface.


GrandExchangeChat.Grid

property TRSGrandExchangeChat.Grid: TBoxArray;

Returns the GrandExchangeChat search grid.

Example:

{$I WaspLib/osrs.simba}
begin
  while True do
    ShowOnTarget(GrandExchangeChat.Grid);
end.
_images/gec_grid.gif

GrandExchangeChat.SetupInterface

procedure TRSGrandExchangeChat.SetupInterface();

Internal method used to setup the TRSGrandExchangeChat coordinates. This is automatically called for you on the GrandExchangeChat variable.


GrandExchangeChat.IsOpen

function TRSGrandExchangeChat.IsOpen(): Boolean;

Returns true if the Grand Exchange is open.

Example:

WriteLn GrandExchangeChat.IsOpen();

GrandExchangeChat.WaitOpen

function TRSGrandExchangeChat.WaitOpen(time: Integer; interval: Integer = -1): Boolean;

Returns true if the Grand Exchange is open within time milliseconds.

Example:

WriteLn GrandExchangeChat.WaitOpen();

GrandExchangeChat.SearchText

property TRSGrandExchangeChat.SearchText: String;
property TRSGrandExchangeChat.SearchText(search: String): Boolean;

Returns the current GrandExchangeChat search or updates it.

_images/gec_search.png

Example:

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

function TRSGrandExchangeChat.Find(item: TRSItem; out bounds: TBox): Boolean;

Returns true if the specified item text is found on the GrandExchangeChat.Grid.

bounds will return the grid box where the item text was found.

Example:

{$I WaspLib/osrs.simba}
var
  b: TBox;
begin
  if GrandExchangeChat.Find('Abyssal whip', b) then
    ShowOnTarget(b);
end.
../../images/gec_Find.png

GrandExchangeChat.Contains

function TRSGrandExchangeChat.Contains(item: TRSItem): Boolean;

Returns true if the specified item text is found on the GrandExchangeChat.Grid.

Example:

WriteLn GrandExchangeChat.Contains('Abyssal whip');

GrandExchangeChat.Click

function TRSGrandExchangeChat.Click(item: TRSItem): Boolean;

Attempts to click the specified item on the GrandExchangeChat.Grid.

Example:

WriteLn GrandExchangeChat.Click('Abyssal whip');

GrandExchangeChat.FindScroll

function TRSGrandExchangeChat.FindScroll(item: TRSItem): Integer;

Attempts to find the scroll level the specified item is found on the GrandExchangeChat.Grid.

Example:

WriteLn GrandExchangeChat.FindScroll('Bandos tassets');

GrandExchangeChat.ScrollTo

function TRSGrandExchangeChat.ScrollTo(item: TRSItem): Boolean;

Attempts to scroll until the specified item is found on the GrandExchangeChat.Grid.

Example:

WriteLn GrandExchangeChat.ScrollTo('Bandos tassets');

GrandExchangeChat variable

Global TRSGrandExchangeChat variable.