Chatbox¶
The chatbox file holds functions and procedures that are used in the Runescape chat box.
type TRSChatbox¶
The type that holds functions and properties of the Runescape chat box interface.
var Chatbox¶
Variable that stores functions and properties of the Runescape chatbox interface.
const CHATBOX_COLORS¶
constant that holds all the possible text-colors
Chatbox.GetTextOnLine¶
function TRSChatbox.GetTextOnLine(line: Int32; colors:TIntegerArray = CHATBOX_COLORS): String;
Returns the text at the given line [0..8]
. 8
is the last line (the input-field)
Example:
// returns the text at line 6
chatbox.GetTextOnLine(6);
Chatbox.FindTextOnLines¶
function TRSChatbox.FindTextOnLines(txt: TStringArray; lines: TIntegerArray; colors:TIntegerArray = CHATBOX_COLORS): boolean;
Returns true if the text in ‘txt’ is found on the ‘lines’ of the chatbox. The lines start with 0 being the bottom chat line.
Example:
// returns True if "Hello" is found on the first 4 lines
chatbox.FindTextOnLines(['Hello'], [0..3]);
Chatbox.GetLastMessage¶
function TRSChatbox.GetLastMessage(colors:TIntegerArray = CHATBOX_COLORS): String;
Returns the text at the last line in the chatbox
Chatbox.GetChatArea¶
function TRSChatbox.GetChatArea(): TBox;
Returns a TBox which only covers the chat-area, does not include the scrollbar and input-field.
Chatbox.ClickContinue¶
function TRSChatbox.ClickContinue(SpamClick: Boolean = False): Boolean;
Clicks the “Click here to continue”-text in the chatbox.
Returns True
if the text was found.
Chatbox.GotLevelUp¶
function TRSChatbox.GotLevelUp(): Boolean;
Returns True
if text containing Congratulations was found
Chatbox.HandleLevelUp¶
function TRSChatbox.HandleLevelUp(): Boolean;
Clicks the “Click here to continue” if text containing Congratulations was found
Chatbox.GetOptions¶
function TRSChatbox.GetOptions(TextColors: TIntegerArray = [clBlack, clWhite]): array of TChatOption;
Returns all the options found in teh chatbox area
Chatbox.ClickOption¶
function TRSChatbox.ClickOption(const Text: TStringArray; TextColors: TIntegerArray = [clBlack, clWhite]): Boolean;
function TRSChatbox.ClickOption(const Text: TStringArray; WaitTime: Integer; TextColors: TIntegerArray = [clBlack, clWhite]): Boolean; overload;
Clicks the preferred option by text. If the option cant be found it will return with False.
Chatbox.PleaseWait¶
function TRSChatbox.PleaseWait(): Boolean;
Waits as long as the “Please wait” text exists.
Chatbox.ChatToOption¶
function TRSChatbox.ChatToOption(Option: TStringArray; ClickOption: Boolean; TextColors: TIntegerArray = [clBlack, clWhite]): Boolean;
I have no clue wtf this is. Therefor it’s either a stupid or an awesome function! Seems to be a function that should have been named something like ContinueToOption (as in click continue until it no longer can)
Chatbox.GetDisplayName¶
function TRSChatbox.GetDisplayName(): String;
Returns your username / display name
Chatbox.ClickTab¶
function TRSChatbox.ClickTab(tab: EChatTab; Option: String = ''): Boolean;
A tab would be the filters for the chatbox. So you click one of them..
Chatbox.GetQuery¶
function TRSChatbox.GetQuery(answer:Boolean=False): String;
Returns the question-text, like “Enter amount:” when doing “Withdraw X” from a bank. If answer is True it returns the value you have filled in.
Chatbox.WaitQuery¶
function TRSChatbox.WaitQuery(Query: String; WaitTime: Int32): Boolean;
Wait till the query shows up. If it doesn’t show up within WaitTime it returns False.
Chatbox.AnswerQuery¶
function TRSChatbox.AnswerQuery(Query, Response: String; WaitTime: Int32; PressEnter:Boolean=True): Boolean;
Answer the query, first it will wait for the quary Query to show up, then it fills in the given Response.
Chatbox.GetButtonQuery¶
function TRSChatbox.GetButtonQuery(): String;
Returns the question-text, like “What would you like to smelt”
Chatbox.WaitButtonQuery¶
function TRSChatbox.WaitButtonQuery(Query: String; WaitTime: Int32): Boolean;
Wait till the query shows up. If it doesn’t show up within WaitTime it returns False.
Chatbox.ClickButtonId¶
function TRSChatbox.ClickButtonId(Query: String; Id:Int32; UpText:String; WaitTime: Int32): Boolean;
Clicks the button Id, checks uptext to verify that the corrrect button was clicked If the given button id doesn’t match the UpText it will sift through the other buttons looking for it.
Chatbox.ClickButtonColor¶
function TRSChatbox.ClickButtonColor(Query: String; Color, Tolerance:Int32; UpText:String; WaitTime: Int32): Boolean;
Clicks the button matching both color and uptext, starting with the one that had the best initial match, and then sifting down to less good matches.
Chatbox.GetTitle¶
function TRSChatBox.GetTitle: String;
Returns the title of a chatbox interaction such as the NPC name.
Chatbox.GetNotification¶
function TRSChatBox.GetNotification: String;
Returns the title of a chatbox notification such as the “inventory is too full”.