Results 1 to 12 of 12

Thread: gettextatex?

  1. #1
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default gettextatex?

    yea can someone explain this function like where to put the x,y and everything else it doesnt work to good for me.

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    this is how i used it

    GetTextAtEx(18, 415, 7, SmallChars, False, False, 0, 0, 0, 50, False, tr_allChars));
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    well can you explain it

  4. #4
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Open SCAR press F1, and find for Text finding funcions.
    There is explained almost all SCAR functions.

  5. #5
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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\');
    That was taken from the SCAR manual. That should answer most of your questions.

  6. #6
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    yea it says reads text at x,y but where is x y i already read that but where do i put x,y where in the word

  7. #7
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    dependa what ur doing...where are u getting ur words from
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  8. #8
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    ok what part of the word like the top left corner just tell me where on the word do i put it.

    is it on the top left corner of the word?

  9. #9
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    ok what part of the word like the top left corner just tell me where on the word do i put it.

    is it on the top left corner of the word?
    Yea, Coordinates must be set exactly at top left corner.
    Also for what do you need this?
    Check out Includes/SRL/SRL/CORE/Text.scar If there is already a function that you need.

  10. #10
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    its for finding run % and i checked there and there was none.

  11. #11
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    This should work:

    SCAR Code:
    function RunLeft: Integer;
    var
      x, y: integer;
    begin
     if IsTextInAreaEx(628, 430, 665, 451, x, y, '%', 50, SmallChars, False, False, 0, 2, 39167) then
       Result := StrToInt(Trim(GetTextAtEx(x -22, y, 50, SmallChars, False, False, 0, 4, 39167, 5, False, tr_Digits)));
    end;
    Hup Holland Hup!

  12. #12
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    ty so much

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. GetTextAtEx
    By batnas in forum OSR Help
    Replies: 4
    Last Post: 02-03-2008, 12:58 PM
  2. GetTextAtEx help, please :)
    By Macro_FTW in forum OSR Help
    Replies: 3
    Last Post: 01-10-2008, 03:27 AM
  3. Trimming and GetTextAtEx help..
    By itSchRis917 in forum OSR Help
    Replies: 9
    Last Post: 07-30-2007, 05:20 PM

Posting Permissions

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