Log in

View Full Version : Can't find text



Lance
03-06-2011, 06:02 PM
I was asking for help on this project before but I've decided to just start a new thread to keep things simple.

I need the script to be able to read numbers, here's an example of zero:
first image is the origional, second is it blown up, third I went into paint and filled in just the solid green with white.
http://img228.imageshack.us/img228/499/examplev.png

Now I noticed in this tutorial by Shuttleu (http://villavu.com/forum/showthread.php?t=60451), the runescape font is very thin and only has a simple black shadow where my font is big and thick and has blue-green, yellow-green, blue and yellow on it's outline.

I've had no success getting my script to recognize and read the text in this font, is it just not possible because my font is to big and has a strange outline?

Wizzup?
03-06-2011, 07:25 PM
It should certainly be possible. Can we see your attempts at doing so?

Lance
03-06-2011, 08:01 PM
It should certainly be possible. Can we see your attempts at doing so?

Certainly, thanks for the speedy response.

This is my script


program New;
{.include YPP/YPP.scar}
{.include DTM.scar}

function FindText(var cx, cy: Integer; txt: string; font, xs, ys, xe, ye: Integer): Boolean; //by Stupid3ooo
var
S: Integer;
begin
S := CreateBitmapMaskFromText(txt, font);
if (xs < 0) then xs := 0;
if (ys < 0) then ys := 0;
Result := FindBitmapMaskTolerance(S, cx, cy, xs, ys, xe, ye, 10, 30);
FreeBitmap(S);
end;

var
x, y, A, B, C, D, Font : Integer;
begin
ActivateClient();
SetupYPP();

Font := LoadChars2('C:\Program Files\SCAR 3.22\Fonts\PokerChars\');
if FindText(x, y, '0', Font, 0, 0, 500, 500) then Writeln(IntToStr(x) + ', ' + IntToStr(y));

Writeln(IntToStr(x) + ', ' + IntToStr(y));
end.


And this is the image named "48.bmp"

http://img34.imageshack.us/img34/3478/75309303.png

Lance
03-08-2011, 01:21 AM
bump. 60 views and no one knows why this isn't working? :P

Edit: I'm using scar as well, is scar outdated maybe?

Wizzup?
03-08-2011, 03:59 PM
http://docs.wizzup.org/simba/scriptref/ocr.html