ChatDialog

Methods to interact with the chat box dialog.

Use the ChatDialog global variable:

WriteLn ChatDialog.IsOpen();

TRSChatDialog.GetTitle

function TRSChatDialog.GetTitle: String;

Returns the title of the chat dialog. Normally this is the name of the person speaking.

Example:

WriteLn(ChatDialog.GetTitle());

TRSChatDialog.IsTitle

function TRSChatDialog.IsTitle(Text: String): Boolean;

Returns if Text is present in GetTitle().

Example:

if ChatDialog.IsTitle('Banker') then
  WriteLn('We are speaking to a banker!');

TRSChatDialog.IsOpen

function TRSChatDialog.IsOpen: Boolean;

Returns True if a chat dialog is open. This is when a player/npc chat is speaking. Or there is a option to select.

Example:

if ChatDialog.IsOpen() then
  WriteLn('Someone is speaking!');

TRSChatDialog.GetOptions

function TRSChatDialog.GetOptions: TRSChatDialogOptions;

Returns all chat options. This is the black text you can click on.


TRSChatDialog.ClickOption

function TRSChatDialog.ClickOption(Text: String; UseKeyboard: Boolean = True): Boolean;

If Text is found in any option, click it.

Example:

if ChatDialog.ClickOption('access my bank account please') then
  WriteLn('Opened bank!')

TRSChatDialog.ChatToOption

function TRSChatDialog.ChatToOption(Option: String; UseKeyboard: Boolean = True): Boolean;

Continuously advances the dialog with TRSChatDialog.ClickContinue until the specified Option appears.

Example:

ChatDialog.ChatToOption('Yes');

TRSChatDialog.ChatToDialog

function TRSChatDialog.ChatToDialog(Dialog: String; UseKeyboard: Boolean = True): Boolean;

Continuously advances the dialog with TRSChatDialog.ClickContinue until the specified Dialog appears.

Example:

ChatDialog.ChatToDialog('What do you do');

TRSChatDialog.HasLevelUp

function TRSChatDialog.HasLevelUp: Boolean;

Do we have the level up message?

Example:

if ChatDialog.HasLevelUp() then
  WriteLn('We have leveled up!')

TRSChatDialog.GetDialog

function TRSChatDialog.GetDialog: String;

Returns the chat dialog which is the black text when a NPC/player is speaking.

Example:

WriteLn(ChatDialog.GetDialog());

ChatDialog.Setup

procedure TRSChatDialog.Setup(Name: String); override;

var ChatDialog