SRL Archive - OSR Help

Using Simba's OCR for UpText


Cstrike

2010-12-03 20:01:08

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

Shuttleu

2010-12-03 20:12:38

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 :p)
font is the name of the folder in the font folder

~shut

Cstrike

2010-12-03 20:37:17

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? :p

Shuttleu

2010-12-03 21:13:29

if thats all you could find, then try messing with the spacing

~shut

Cstrike

2010-12-03 21:40:16

From: Shuttleu
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' :(

Wizzup?

2010-12-04 05:25:49

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.

Shuttleu

2010-12-04 06:00:49

how about you send me your font and where this is for and i can give it a go

~shut

Cstrike

2010-12-04 11:20:28

From: Wizzup?
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

From: Shuttleu
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
    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