Chat¶
The Chat include contains all chat-related functions
Contents
- Chat
- SetChat
- SetAllChats
- ChatsOff
- ChatWait
- ClickContinueEx
- ClickContinue
- ClickToContinue
- TextCoords
- GetChatBoxText
- FindChatBoxText
- IsChatBoxTextBetween
- IsChatBoxTextAnyLine
- ChatBoxTextArray
- GetBlackChatMessage
- FindBlackChatMessage
- LastChatter
- GetLastChatText
- InChat
- FixChat
- SaveToChatLog
- ColorEffectAdd
- GetNPCChatName
- AreTalking
- DoConversation
- PlayerChatActive
const
CHAT_GAME = 0;
CHAT_PUBLIC = 1;
CHAT_PRIVATE = 2;
CHAT_CLAN = 3;
CHAT_TRADE = 4;
CHAT_ASSIST = 5;
SetChat¶
function SetChat(state: string; chat: Integer): Boolean;
Sets Chat to desired state Game Public Private Clan Trade Assist 0 1 2 3 4 5
Note
by Wizzup?, WT-Fakawi, Starblaster100, N1ke! & Coh3n
Example:
SetAllChats¶
procedure SetAllChats(Game, Pub, Priv, Clan, Trade, Assist: string);
Sets all the chats to a particular state in one simple procedure. Leave the parameter as ‘’ if you wish to leave the chat as it is.
Note
by ZephyrsFury
Example:
SetAlChats('all', 'Hide', '', 'Off', '', 'Friend');
ChatWait¶
procedure ChatWait;
Waits while there’s Please Wait in the chatbox.
Note
by Nielsie95
Example:
ClickContinueEx¶
function ClickContinueEx(Click, Wait: Boolean): Boolean;
Returns true if the blue ‘Click To Continue’ text in the chat box is found. If will click if Click = True, calls ChatWait if Wait = True.
Note
by _ChArMz & Narcle (Original by EvilChicken!)
Example:
ClickContinue¶
function ClickContinue(SpaceBar, DoWait: Boolean): Boolean;
Returns true if the green button in the chat box is found. It will SpaceBar if true otherwise will mouse it. If DoWait = true will wait until color count changes.
Note
by _ChArMz & Narcle (Original by EvilChicken!)
Example:
ClickToContinue¶
function ClickToContinue: Boolean;
Click the blue ‘Click To Continue’ text in the chat box.
Note
by ZephyrsFury
Example:
TextCoords¶
Function TextCoords(textn: Integer): TPoint;
Returns x, y for text. (1 to 8)
Note
by Wizzup?
Example:
GetChatBoxText¶
function GetChatBoxText(Line, TextCol: Integer): string;
Gets text on the line Line with colour TextCol. (Line 1 is the top, Line 8 is the bottom line). Colours:
- clMessage/clBlack - Black text messages (“Oh Dear you are dead”, etc).
- clChat/clBlue - Chat messages from you and other players.
- clTrade/clPurple - Colour of trade request text.
- clFriend - Colour of friend and clan chat.
Works with other colours too.
Note
by ZephyrsFury
Example:
FindChatBoxText¶
function FindChatBoxText(Text: string; Line: Integer; TextCol: Integer): Boolean;
Searches for Text on Line with colour TextCol. True if found.
Note
by ZephyrsFury
Example:
IsChatBoxTextBetween¶
function IsChatBoxTextBetween(Text: string; TextCol, StartLine, EndLine: Integer): Boolean;
Returns true if Text with colour TextCol is found anywhere in the chat box.
Note
by ZephyrsFury
Example:
IsChatBoxTextAnyLine¶
function IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
Returns true if Text with colour TextCol is found anywhere in the chat box.
Note
by ZephyrsFury
Example:
ChatBoxTextArray¶
function ChatBoxTextArray(TextCol: Integer): TStringArray;
Gets and return a TStringArray with the contents of each line
with the colour TextCol (see GetChatBoxText for list of colours).
Gets and return a TStringArray with the contents of each line
with the colour TextCol (see GetChatBoxText for list of colours).
- Line 1 is Result[1]
- Line 2 is Result[2]
- Line 3 is Result[3]
- Line 4 is Result[4]
- Line 5 is Result[5]
- Line 6 is Result[6]
- Line 7 is Result[7]
- Line 8 is Result[8]
Note
by ZephyrsFury
Example:
GetBlackChatMessage¶
function GetBlackChatMessage: String;
Gets text with color 0 in last chat line.
Note
by Wizzup?
Example:
FindBlackChatMessage¶
function FindBlackChatMessage(ChatMsg: String): Boolean;
Returns True if text with color 0 in last chat line is found.
Note
by Wizzup?
Example:
LastChatter¶
function LastChatter(var name: String): Boolean;
Returns name and true if a person was talking, or false and the text
Note
by masquerader
Example:
GetLastChatText¶
function GetLastChatText(var chat: String): Boolean;
Returns true if blue chat text was found
Note
by masquerader / Wizzup?
Example:
InChat¶
function InChat(Text: String): Boolean;
Grabs Last Chat Line and performs checks on occurence of text
Note
by WT-Fakawi
Example:
FixChat¶
procedure FixChat;
Scrolls ChatText scrollbar down.
Note
by WT-Fakawi, Edited Mar. 30th, 2013 by Le Jingle (time out fail safe)
Example:
SaveToChatLog¶
procedure SaveToChatLog;
Saves chat to log file.
Note
by WT-Fakawi & masquerader
Example:
ColorEffectAdd¶
function ColorEffectAdd(Color, Effect: Boolean): string;
Returns a RS chat effect based on ‘Color’ and ‘Effect’ booleans.
Note
by NiCbaZ
Example:
GetNPCChatName¶
function GetNPCChatName(): string;
Gets the name of the random event NPC from the top of the chat box. The proper font doesn’t exist yet, so it returns a random string of characters.
Note
Author: DemiseSythe Last Modified: Jan. 22nd, 2012 by Coh3n
Example:
writeln(getNPCChatName());
AreTalking¶
function AreTalking(): boolean;
Returns true if player is talking to an NPC.
Note
Author: Wizzup? Last Modified: Jan. 22nd, 2012 by Coh3n
Example:
while (areTalking()) do
clickContinue(true, true);
DoConversation¶
function DoConversation(resultText: string; clickresult: boolean): boolean;
Goes through the initial dialog of a random. Will keep clicking to continue until the conversation’s ‘resultText’ is found. Will click to continue when ‘resultText’ is found if ‘clickresult’ is set to true. Set ‘resultText’ to ‘’ to click continue until conversation is over.
Note
Author: Coh3n Last Modified: Jan. 22nd, 2012 by Coh3n
Example:
if (DoConversation('thank', true)) then
writeln('Finished conversation');
PlayerChatActive¶
function PlayerChatActive: Boolean;
Return true if player chat is active.
Note
by riwu
Example: