Results 1 to 17 of 17

Thread: RSC Font + creating an OCR?

  1. #1
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default RSC Font + creating an OCR?

    Hello, I'm completely new here and was wondering if someone could help answer some/all of my following questions:

    1) I was wondering if anyone had made the RSC font for use with Simba?

    2) How would I go about "adding" a custom font into Simba, and could someone quickly demonstrate how I would read a line of text using Simba's OCR?

    3) How are SCAR and Simba related? Is it possible to do the "work" of the bot with SCAR, but somehow send information to and from Simba which works as the OCR which guides the SCAR script? Or can Simba do all of what SCAR does?


    Thanks

  2. #2
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by ausdreamer View Post
    Hello, I'm completely new here and was wondering if someone could help answer some/all of my following questions:

    1) I was wondering if anyone had made the RSC font for use with Simba?

    2) How would I go about "adding" a custom font into Simba, and could someone quickly demonstrate how I would read a line of text using Simba's OCR?

    3) How are SCAR and Simba related? Is it possible to do the "work" of the bot with SCAR, but somehow send information to and from Simba which works as the OCR which guides the SCAR script? Or can Simba do all of what SCAR does?


    Thanks
    1) Don't think anyone has posted it on the forums.
    2) http://villavu.com/forum/showthread.php?t=60451 << instructions
    Use FindText(x, y, 'text here', font name, xs, ys, xe, ye) to find the text.
    3)By "work" do you mean moving mouse and stuff like that? then yes simba can do all of what scar can do.

  3. #3
    Join Date
    Apr 2007
    Location
    Lithuania
    Posts
    384
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Both simba and scar would suit your needs. Simba is open source.
    SRL probobly won't help you a bit, because that's not the same game your trying to work on.

  4. #4
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    This thread has some bitmaps already made for you. I posted them but not sure if they all work.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  5. #5
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, now I have the folder ClassicChars folder in my Fonts folder in Simba, but am unsure how to actually call the functions 'LoadFont' and 'GetTextAtEx' ... I've never used Simba and am unsure how to define the variables and call the functions.

    Thanks for your help so far guys

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Check this tutorial.

  7. #7
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK so I've used that tutorial and written the following code:
    Code:
    program new;
    
    var
      Font: String;
      shadow: Boolean;
      text: String;
    begin
      Font := 'ClassicChars';
      Text := 'hehe';
      Shadow := True;
      LoadFont(Font,Shadow);
      BitmapFromText(Text,Font);
      // not up to using this just yet... GetTextAtEx(939,296,1495,500,0,50,0,16777215,1000,'ClassicChars')
    end.
    but i get the error: 'Error: Exception: Font [ClassicChars] not found. at line 12'

    Why's this?

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I'm not sure, but you may need to set "Font" to the font path. Like,
    Simba Code:
    Font := AppPath + 'Fonts\ClassicChars\';
    I'm not exactly sure how the font stuff works, but it's worth a try.

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

    Default

    Once you have created your fonts properly following a good tutorial, using correct spacing etc.

    This is how you would utilize it

    SCAR Code:
    var
      ClassicChars: Integer;

    begin
      ClassicChars := LoadChars2(FontsPath + 'ClassicChars\');
      WriteLn(GetTextAtEx(123, 123, 0, ClassicChars, False, False, -1, 2, clWhite, 99, False, tr_AllChars));
      FreeChars2(ClassicChars);
    end.

  10. #10
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wanted View Post
    Once you have created your fonts properly following a good tutorial, using correct spacing etc.

    This is how you would utilize it

    SCAR Code:
    var
      ClassicChars: Integer;

    begin
      ClassicChars := LoadChars2(FontsPath + 'ClassicChars\');
      WriteLn(GetTextAtEx(123, 123, 0, ClassicChars, False, False, -1, 2, clWhite, 99, False, tr_AllChars));
      FreeChars2(ClassicChars);
    end.
    OK I've managed to find my fonts and load them in SCAR. But I'll keep my questions here for anyone reading this later:P // Sorry if this is a n00b question, but LoadChars2 isn't a function in Simba?? Unless you're talking about SCAR, in which case, where should I place my ClassicChars folder?
    Last edited by ausdreamer; 10-02-2011 at 08:42 PM.

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

    Default

    Quote Originally Posted by ausdreamer View Post
    Sorry if this is a n00b question, but LoadChars2 isn't a function in Simba?? Unless you're talking about SCAR, in which case, where should I place my ClassicChars folder?
    Anywhere is fine but for that specific path Tools->Explorer->Fonts Folder

  12. #12
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well now that I'm using SCAR, is there a function to search for text in a rectangular box, like GetTextAtEx(); in Simba?

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

    Default

    Quote Originally Posted by ausdreamer View Post
    Well now that I'm using SCAR, is there a function to search for text in a rectangular box, like GetTextAtEx(); in Simba?
    In SCAR there is
    SCAR Code:
    function IsTextInAreaEx(x1, y1, x2, y2: Integer; var x, y: Integer; S: string; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer): Boolean;

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

    Default




    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)

  15. #15
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thank you for your help, I just don't know what to make the x,y variables in IsTextInAreaEx() because isn't the point of this function to search in the rectangle x1,y1,x2,y2 rather than at a specific point.. ?

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

    Default

    Quote Originally Posted by ausdreamer View Post
    Ok thank you for your help, I just don't know what to make the x,y variables in IsTextInAreaEx() because isn't the point of this function to search in the rectangle x1,y1,x2,y2 rather than at a specific point.. ?
    Those are just two variables that return the position of the text. The x1, y1, x2, y2 create the box to search in.

    SCAR Code:
    var
      X, Y: Integer;
    begin
      IsTextInArea(... X, Y ...);
    end.

  17. #17
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This makes sense, thank you very much...Thanks to everyone who helped, much appreciated ^_^

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
  •