PDA

View Full Version : RSC Font + creating an OCR?



ausdreamer
10-02-2011, 06:13 AM
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 :)

KingKong
10-02-2011, 07:22 AM
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.

bevardis
10-02-2011, 08:28 AM
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.

weequ
10-02-2011, 10:25 AM
This (http://villavu.com/forum/showthread.php?t=52816) thread has some bitmaps already made for you. I posted them but not sure if they all work.

ausdreamer
10-02-2011, 03:26 PM
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 :)

NCDS
10-02-2011, 03:53 PM
Check this (http://villavu.com/forum/showthread.php?t=58935) tutorial.

ausdreamer
10-02-2011, 05:05 PM
OK so I've used that tutorial and written the following 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?

Coh3n
10-02-2011, 06:10 PM
I'm not sure, but you may need to set "Font" to the font path. Like,

Font := AppPath + 'Fonts\ClassicChars\';
I'm not exactly sure how the font stuff works, but it's worth a try.

Wanted
10-02-2011, 06:33 PM
Once you have created your fonts properly following a good tutorial, using correct spacing etc.

This is how you would utilize it

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.

ausdreamer
10-02-2011, 07:33 PM
Once you have created your fonts properly following a good tutorial, using correct spacing etc.

This is how you would utilize it

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?

Wanted
10-02-2011, 07:44 PM
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

ausdreamer
10-02-2011, 07:59 PM
Well now that I'm using SCAR, is there a function to search for text in a rectangular box, like GetTextAtEx(); in Simba?

Wanted
10-02-2011, 08:05 PM
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 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;

Wizzup?
10-02-2011, 08:19 PM
See http://docs.villavu.com/simba/scriptref/ocr.html#loadfont on how to load a Font.

ausdreamer
10-02-2011, 08:34 PM
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.. ?

Wanted
10-02-2011, 08:37 PM
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.

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

ausdreamer
10-02-2011, 08:42 PM
This makes sense, thank you very much...Thanks to everyone who helped, much appreciated ^_^