Results 1 to 8 of 8

Thread: Using Simba's OCR for UpText

  1. #1
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Using Simba's OCR for UpText

    I have all the RSCFonts that I wanted just to mess around in RSC.

    What I've done is, first I renamed them based on Shuttleu's tutorial, so they have the right BMP number. Next I put them in Simba's /Fonts/RSCChars, and then I tested them. I can make TPA's out of the with the OCR TPAFromText function, and I can make a bitmap with BitmapMaskFromText or w/e it's called, but I don't know what to do next. Also I have no idea what a TMask is.


    What must I do to be able to find the uptext properly? What would you do?


    EDIT: I tried finding them on screen but it doesnt work :/ Yes I know I'm generic, lets see if you need more input from me or can help me from here
    Last edited by Cstrike; 12-04-2010 at 01:10 AM.

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    you need to find the position that the text starts from
    then you can use
    function GetTextAt(const atX, atY, minvspacing, maxvspacing, hspacing, color, tol, len: integer; const font: string): string;

    constX and constY are the position the text start at
    minvspacing and maxvspacing are the spacing in between the characters (this will usually be set to 0)
    hspacing (highlight spacing?) i have no idea about
    color is the color of the text
    tol is the tolerance (as im sure you could have guessed )
    font is the name of the folder in the font folder

    ~shut

  3. #3
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    So far I made all those variables for everything (x, y, everything above new to me...etc), and was only able to find 'cl' from 'climb-ladder'
    I wonder how Simba gets RS2 text?

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  5. #5
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Shuttleu View Post
    if thats all you could find, then try messing with the spacing

    ~shut
    Tried using for/loop with each variable, like
    for
    -- for
    ---- for
    ------ for

    Most I could find is 'cl'

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

    Default

    Try creating a bitmap with your font and save it to some place. See how well the spacing looks. If the spacing looks good, then the OCR probably works well too.



    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)

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  8. #8
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Try creating a bitmap with your font and save it to some place. See how well the spacing looks. If the spacing looks good, then the OCR probably works well too.
    Thats a good idea, didn't think of that
    Going to try it now
    EDIT: Attached, looks go so far [see attachment]
    I must be coding it wrong

    Quote Originally Posted by Shuttleu View Post
    how about you send me your font and where this is for and i can give it a go

    ~shut
    PMing you right now


    EDIT2: YAY GOT IT WORKING
    Simba Code:
    S := CreateBitmapMaskFromText('please.', RSCChars);
        writeln(FindBitmapMaskTolerance(S, x, y, 0, 0, 720, 515, 10, 10));
        FreeBitmap(S);
    Apparently those two tolerance #'s at the end did the trick
    Last edited by Cstrike; 12-04-2010 at 04:44 PM.

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
  •