The Text include contains all sorts of functions used for finding, analysing and using text in RS. It also contains a few useful input routines
function srl_Explode(str, del: string): TStringArray;
Explodes a string into TStringArray, seperated by del.
Note
by mixster
Example:
function srl_Implode(Pieces: TStringArray; Glue: string): string;
Combines Pieces in a single string seperated by Seperator
Note
by ZephyrsFury & mixster
Example:
procedure TypeSendEx(Text : string; PressEnter : Boolean);
Types text in a human-like way.
Note
by SKy Scripter
Example:
procedure TypeSend(Text : string);
Types Text in a human-like way and presses enter. Wrapper function for TypeSendEx for compatibility purposes.
Note
by N1ke!
Example:
function AddMistakes(Orig: string; Chance: Integer): string;
Adds human mistakes to Orig such as mistypes, missing letters, wrong cases. Probability that a character is typed wrong is 1 / Chance. ie. Higher ‘Chance’ = less mistakes (I know thats stupid but oh well...). Probability is the chance that an individual character is typed incorrectly. That is if you have more characters in a string you will get more mistakes overall. 20 - 30 is usually good but it varies depending on your string so experiment!
Note
by Zephyrsfury
Example
function GetUpText : string;
Returns the text in the upperleft corner (often referred to as UpText).
Note
by Freddy1990
Example:
function IsUpText(UpText : string) : Boolean;
Returns True if there is currently Uptext on the screen
Note
by Freddy1990
Example:
function IsUpTextMultiCustom(Text: TStringArray): Boolean;
Checks for the occurance of any of the strings in the array.
Note
by Starblaster100 & Nielsie95 & Freddy1990
Example:
IsUpTextMultiCustom(['Att', 'ttac', 'ack', 'monst', 'ster'])
function GetLevelAtPos(x, y : integer) : integer;
Returns the level of the characater found at (x, y), uses uptext. Returns -1 if none are found.
Note
by marpis and Nava2
Example:
function FindNPCChatText(txt: string; Action: fnct_ActionOptions): Boolean;
Finds a text said by a NPC in chat. If found it’ll perform action, where action can be: Nothing - Just return wether its found Move - Just move the mouse to it Clickleft - Movemouse & Clickmouse left Clickright - MoveMouse & Clickmouse right
Note
by Kernel Klink and Nielsie95
Example:
function FindText(var cx, cy: Integer; txt,font: string; xs, ys, xe, ye: Integer): Boolean;
Searches for text in specified box with specified font.
Note
by Stupid3ooo
Example:
function ClickText(Text, Chars: string;x1, y1, x2, y2: Integer; Left: Boolean): Boolean;
Clicks Text if found in the specified box.
Note
by SKy Scripter
Example
Function LoadTextTPA(Text : String; Chars : Integer;var height : integer) : TPointArray;
Loads a TPA of the text.. It also returns the real height of the Text. Used in FindTextTPAinTPA.
Note
by Raymond
Example
function FindTextTpaEx(Color,Tol,xs,ys,xe,ye : integer;var x,y : integer; Txt : string; Chars : Integer; Action : (ClickLeft,ClickRight,Move,Nothing)) : Boolean;
Uses TPA’s to find text..Returns the found pos in x and y (if not found both are 0) In action you can put what you want to do after its found.. Nothing - Just return wether its found Move - Just move the mouse to it Clickleft - Movemouse & Clickmouse left Clickright - MoveMouse & Clickmouse right
Note
by Raymond
Example:
function FindTextTpa(Color,Tol,xs,ys,xe,ye : integer; Txt : string; Chars : Integer; Action : (ClickLeft,ClickRight,Move,Nothing)) : Boolean;
Just like FindTextTpaEx, but without the x and y pos returning.
Note
by Raymond
Example:
function FindTextTPAMulti(Color, tol, xs, ys, xe, ye: integer; Texts: TStringArray; Chars: string;/integer; Action: fnct_ActionOptions): Boolean;
Just like FindTextTPA, only that it takes an array of strings as text to search for.
Note
by Cigue and EvilChicken!
Example:
function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
Finds Popup menu, then clicks on it. Will look for the first string first and so on. It will search for the Text Type you input valid arguments are ‘action’, ‘player’: The white text ‘npc’: The yellow text ‘object’: The cyan text ‘all’: Searches for all colors of text. Will default to ‘all’.
Note
by Wizzup? & Nava2 & N1ke!
Example:
function ChooseOptionMulti(Txt: TStringArray): Boolean;
Finds Popup menu, then clicks on it. Will look for the first string first and so on.
Note
by Wizzup? & N1ke!
Example:
function ChooseOptionEx(Txt, TextType: string): Boolean;
Finds an option in a popup menu, then clicks on it. Searches for TextType. See ChooseOptionMultiEx for valid options. Default is ‘all’.
Note
by Wizzup?
Example:
function ChooseOption(txt: String): Boolean;
Finds an option in a popup menu, then clicks on it.
Note
by Wizzup?
Example:
function OptionsExist(txt: TStringArray; Move: boolean): boolean;
Returns true if an Option in txt is found in the RS Option Menu, will move or do nothing according to the boolean Move.
Note
by Rasta Magician
Example
function CloseWindow: Boolean;
Closes any open windows. (In RS not your pc roflmaololz, j/k)
Note
by NaumanAkhlaQ & Narcle & Nava2
Example:
function InStrArrEx(S: string; StrArr: TStringArray; var Where: Integer): Boolean;
Returns true if the string S was found in the StrArr, and if so stores the index into Where.
Note
by n3ss3s
Example:
function StrInArr(str: string; arrS: TStringArray): Boolean;
Returns True if str is found in the Array. Case sensitive.
Note
by Narcle & Nava2
Example:
function ArrInStr(arrS: TStringArray; str: string): Boolean;
Returns True if the Array is found in the str. Case sensitive.
Note
by Narcle & Nava2
Example: