Chat

The Chat interface is the interface that shows up at the bottom left corner of the game client where you can communicate with other players, receive game messages and even interact with some options and menus it hosts like the Make menu.

_images/chat_interface.png

ERSChatColor

ERSChatColor = enum(
  BLACK, MAROON, BLUE, PURPLE, RED, LIGHT_RED, WHITE, LIGHT_PURPLE, NAVY, GREEN
);

Enum representing each of the available chat text colors.


ERSIronMan

ERSIronMan = enum(NONE, IRONMAN, HARDCORE, ULTIMATE, GROUP, HARCORE_GROUP, UNRANKED_GROUP);

Enum representing each of the available ironman types.


TRSChat

Main record used to interact with the Chat interface.


Chat.SetupInterface

procedure TRSChat.SetupInterface();

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


Chat.Tabs variable

Tabs: TRSChatTabs;

For more information on chat tabs read ChatTabs.

You can access the TRSChat ChatTabs through the Tabs variable:

ShowOnTarget(Chat.Tabs.Bounds);
_images/chattabs_bounds.png

Chat.GetColors

function TRSChat.GetColors(colors: ERSChatColorArray): TColorArray;

Convenience method used to conver the human readable colors in a ERSChatColorArray format into a TColorArray which has the colors in BGR format.

Example:

WriteLn Chat.GetColors([ERSChatColor.RED, ERSChatColor.WHITE]);

Chat.GetDisplayNameBox

function TRSChat.GetDisplayNameBox(out color: Integer): TBox;
function TRSChat.GetDisplayNameBox(): TBox; overload;

Returns the bounds of the display name on the Chat box. You can optionally get the display name color back through the color variable.

Example:

ShowOnTarget(Chat.GetDisplayNameBox());

Chat.GetDisplayName

function TRSChat.GetDisplayName(): String;

Returns the account display name on the Chat box as a string.

Example:

WriteLn Chat.GetDisplayName();

Chat.GetIronManType

function TRSChat.GetIronManType() : ERSIronMan;

Returns the account ironman type.

Example:

WriteLn Chat.GetIronManType();

Chat.IsTransparent

function TRSChat.IsTransparent(): Boolean;

Returns true if the Chat box is in transparent mode.

Example:

WriteLn Chat.IsTransparent();

Chat.IsOpen

function TRSChat.IsOpen(): Boolean;

Returns True/False if the Chat is open.

Example:

if Chat.IsOpen() then
  ShowOnTarget(Chat.Bounds);

Chat.Close

function TRSChat.Close(): Boolean;

Attempts to close the Chatinterface.

Example:

WriteLn Chat.Close();

Chat Queries

A chat query is when you have some kind of question on the chatbox which you have to reply to.

For example, when you try to “withdraw-x” from the bank, you are asked for the quantity:

_images/chat_query.png

A chat query.


Chat.GetQuery

function TRSChat.GetQuery(): String;

Returns the query shown on the Chat interface if any as a string.

Example:

WriteLn Chat.Close();

Chat.GetQueryAnswer

function TRSChat.GetQueryAnswer(): String;

Returns the query current answer to the query in the Chat interface if any.

Example:

WriteLn Chat.GetQueryAnswer();

Chat.FindQuery

function TRSChat.FindQuery(query: String; caseSensitive: Boolean = False): Boolean;

Returns the True/False if the Chat interface currently has the specified query visible.

Example:

WriteLn Chat.FindQuery('Enter amount');

Chat.WaitQuery

function TRSChat.WaitQuery(query: String; caseSensitive: Boolean = False; time: Integer = 600; interval: Integer = -1): Boolean;

Returns the true if the specified query is visible in the Chat interface within time milliseconds.

Example:

WriteLn Chat.WaitQuery('Enter amount');

Chat.AnswerQuery

function TRSChat.AnswerQuery(query, answer: String; waitTime: Integer = 600; interval: Integer = -1): Boolean;

Attempts to reply to the specified query with answer if it’s available in the Chat interface within waitTime milliseconds.

Example:

WriteLn Chat.AnswerQuery('Enter amount', '15');

Chat.GetMessage

function TRSChat.GetMessage(line: Integer; colors: TIntegerArray = []): String;

Get the message in the specified line.

Example:

WriteLn Chat.GetMessage(5);

Credits: Heavily based on Olly’s solution for this on his 2.0 library.


Chat.FindMessageLine

function TRSChat.FindMessageLine(msg: String; caseSensitive: Boolean = False; colors: TIntegerArray = []): Integer;

Find which line has a specific msg either entirely or partially if any.

Example:

WriteLn Chat.FindMessageLine('Hello world');

Chat.ContainsMessage

function TRSChat.ContainsMessage(msg: String; caseSensitive: Boolean = False; colors: TIntegerArray = []): Boolean;

Returns True/False if the specified msg is visible on the Chat interface.

Example:

WriteLn Chat.ContainsMessage('Hello world');

Chat.InputHasText

function TRSChat.InputHasText(): Boolean;

Returns True/False if input line has text written that was never sent.

Example:

WriteLn Chat.InputHasText();

Chat variable

Global TRSChat variable.