Results 1 to 6 of 6

Thread: Scar Text Reading Capability

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

    Default Scar Text Reading Capability

    Can Scar read text off of... lets say a notepad or another window?

    I know there are functions to take text off of websites through html, but that will not help here.

    What I would like to do is have scar read text from one window and re-type it using typesend(); I do not want it to use Ctrl+C and Ctrl+V or any variation of copy/paste.

    Anyone have ideas?
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Should be easy, view your SCAR manual for OCR functions to pick up any font that you can load with a (.tff? .ttf?)

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

    Default

    Quote Originally Posted by IceFire908 View Post
    Should be easy, view your SCAR manual for OCR functions to pick up any font that you can load with a (.tff? .ttf?)
    Thank you, so far I have noticed these two functions may work well for this task.

    SCAR Code:
    function LoadCharsFromFont2(fontname: string; fontsize: Integer; fontbold, fontitalic, fontunderline, fontstrike: Boolean):

    function GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange)

    I was wondering where GetTextAtEx stores the variable... I'm having a moment of stupidity..
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  4. #4
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's the function result.

    S := GetTextAtEx(....);

  5. #5
    Join Date
    Jan 2007
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    It's the function result.

    S := GetTextAtEx(....);
    So this is what I have so far.

    SCAR Code:
    program New;

    Var
      FONT:integer;
      TYPE1:string;

    begin
      FONT := LoadCharsFromFont2('Courier New', 8, False, False, False, False);
      Writeln('waiting');
      Wait(2000);
      TYPE1 := GetTextAtEx(200,120,130,FONT,False,False,0,0,-1,50,False,tr_AllChars);
      Writeln(TYPE1);
    end.

    and this is the error I am getting

    Code:
    Successfully compiled (81 ms)
    [Runtime Error] : Exception: Access violation at address 007877A7 in module 'scar.exe'. Read of address 00000000 in line 8 in script C:\Desktop\Text ID.scar
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    It is possible to read from other windows, but not particularly easy. Especially since I assume you'll also want to target the window AND the script.

    Here is a guide to the OCR, including proper font loading. You should be able to use the font with GetTextAt / GetTextAtEx.

    http://docs.wizzup.org/simba/scriptref/ocr.html

    E: Didn't see it was for SCAR. Moved to the appropriate section.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

Thread Information

Users Browsing this Thread

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

Posting Permissions

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