Results 1 to 3 of 3

Thread: I have made a charset... now what?

  1. #1
    Join Date
    Jan 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default I have made a charset... now what?

    Hey all I made a charset for a game I play and now I want to make my script read text... how do I do that?

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    From SRL:

    Name your charset
    var UpChars: Integer;

    Load it with path relative to SCAR folder if you use AppPath
    UpChars := LoadChars2(AppPath + 'includes\SRL\UpChars\');

    Use GetTextAtEx
    From SCAR manual
    function GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange) : String; - reads text at position specified by x, y. Tolerance specifies acceptable color range in for characters that are not completely monochrome, Chars specifies font number returned by LoadChars2 or LoadCharsFromFont2, CheckShadow specifies whether function should look for shadow, CheckOutline specifies whether function should verify if character borders are correct, MinSpacing and MaxSpacing are RS1 and RS2 specific parameters for text with changing spacing between characters, in other cases use MinSpacing=0 and MaxSpacing=0, TextColor specifies text color, if set to -1, will search for text in any color, TextLength - maximal text length to read, if Strict is set to true then it won't find characters that contain additional pixels of character's color in the same area as character is, Range can have following values:
    tr_AllChars - read all characters;
    tr_BigLetters - read capital Latin letters;
    tr_SmallLetters - read lowercase Latin letters;
    tr_Digits - read digits;
    tr_BigSymbols - read symbols that are big in size, like "=", "%", "$", etc;
    tr_SmallSymbols - read small symbols like ".", ",", "'", etc;
    tr_SecondTableChars - read symbols with character code above 127;
    tr_Letters = tr_BigLetters or tr_SmallLetters;
    tr_AlphaNumericChars = tr_Letters or tr_Digits;
    tr_Symbols = tr_BigSymbols or tr_SmallSymbols;
    tr_NormalChars = tr_AlphaNumericChars or tr_Symbols;
    Example:
    GetTextAtEx(9, 9, 130, UpChars, True, False, 0, 1, $E0E0E0, 20, False, tr_AlphaNumericChars) - read RS2 upper text in this color.
    GetTextAtEx(96, 387, 0, ChatChars, False, False, 0, 0, -1, 20, True, tr_NormalChars) - read RS2 chat text in any color.
    UpChars and ChatChars are set up during script initialization like this:
    UpChars:= LoadChars2(AppPath + 'CharsRS22\');
    ChatChars:= LoadChars2(AppPath + 'CharsChat2\');

    There are examples of its use in srl/core/text.scar. It's a pain to get the settings right, good luck.

  3. #3
    Join Date
    Jan 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for that... I'll try my best and contact you later

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I've made a vow...
    By Dunceiam in forum News and General
    Replies: 6
    Last Post: 01-07-2008, 03:37 AM
  2. idk if this can be made
    By state champ in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 06-26-2007, 04:25 AM
  3. I just made this sig
    By YoHoJo in forum Semi Stupid Pictures
    Replies: 8
    Last Post: 06-11-2006, 09:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •