Text ==== 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 srl_Explode ~~~~~~~~~~~ .. code-block:: pascal function srl_Explode(str, del: string): TStringArray; Explodes a string into TStringArray, seperated by del. .. note:: by mixster Example: .. code-block:: pascal srl_Implode ~~~~~~~~~~~ .. code-block:: pascal function srl_Implode(Pieces: TStringArray; Glue: string): string; Combines Pieces in a single string seperated by Seperator .. note:: by ZephyrsFury & mixster Example: .. code-block:: pascal TypeByte ~~~~~~~~ .. code-block:: pascal procedure TypeByte(k: Byte); Types one charactar k. .. note:: by Mutant Squirrle Example: .. code-block:: pascal TypeSendEx ~~~~~~~~~~ .. code-block:: pascal procedure TypeSendEx(Text : string; PressEnter : Boolean); Types text in a human-like way. .. note:: by SKy Scripter Example: .. code-block:: pascal TypeSend ~~~~~~~~ .. code-block:: pascal 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: .. code-block::pascal AddMistakes ~~~~~~~~~~~ .. code-block:: pascal 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 .. code-block:: pascal GetUpText ~~~~~~~~~ .. code-block:: pascal function GetUpText : string; Returns the text in the upperleft corner (often referred to as UpText). .. note:: by Freddy1990 Example: .. code-block:: pascal IsUpText ~~~~~~~~ .. code-block:: pascal function IsUpText(UpText : string) : Boolean; Returns True if there is currently Uptext on the screen .. note:: by Freddy1990 Example: .. code-block:: pascal IsUpTextMultiCustom ~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function IsUpTextMultiCustom(Text: TStringArray): Boolean; Checks for the occurance of any of the strings in the array. .. note:: by Starblaster100 & Nielsie95 & Freddy1990 Example: .. code-block:: pascal IsUpTextMultiCustom(['Att', 'ttac', 'ack', 'monst', 'ster']) GetLevelAtPos ~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal FindNPCChatText ~~~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal FindText ~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal ClickText ~~~~~~~~~ .. code-block:: pascal 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 .. code-block:: pascal LoadTextTPA ~~~~~~~~~~~ .. code-block:: pascal 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 .. code-block:: pascal FindTextTpaEx ~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal FindTextTPA ~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal FindTextTPAMulti ~~~~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal ChooseOptionMultiEx ~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal ChooseOptionMulti ~~~~~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal ChooseOptionEx ~~~~~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal ChooseOption ~~~~~~~~~~~~ .. code-block:: pascal function ChooseOption(txt: String): Boolean; Finds an option in a popup menu, then clicks on it. .. note:: by Wizzup? Example: .. code-block:: pascal OptionsExist ~~~~~~~~~~~~ .. code-block:: pascal 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 .. code-block:: pascal CloseWindow ~~~~~~~~~~~ .. code-block:: pascal function CloseWindow: Boolean; Closes any open windows. (In RS not your pc roflmaololz, j/k) .. note:: by NaumanAkhlaQ & Narcle & Nava2 Example: .. code-block:: pascal InStrArrEx ~~~~~~~~~~ .. code-block:: pascal 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: .. code-block:: pascal StrInArr ~~~~~~~~ function StrInArr(str: string; arrS: TStringArray): Boolean; Returns True if str is found in the Array. Case sensitive. .. note:: by Narcle & Nava2 Example: .. code-block:: pascal ArrInStr ~~~~~~~~ .. code-block:: pascal function ArrInStr(arrS: TStringArray; str: string): Boolean; Returns True if the Array is found in the str. Case sensitive. .. note:: by Narcle & Nava2 Example: .. code-block::pascal