SRL Archive - Development

loading system font


Dave

2010-09-05 16:27:21

I've been using scar for a while for autoing on another game, I wont mention the name as it's irrelevant and it's only a small time game so I don't want to increase my risk of getting banned.

I'm moving over to using simba now. So there's my back story. Here's my problem:

I want to be able to find text in a game, in scar I loaded the arial font from windows files using scar's function:

fontName := LoadCharsFromFont2('Arial', 8, False, False, False, False);

in simba I see there is a function called loadsystemfont() but I can't work out how to use this. Also once I've loaded this font I assume I can use GetTextAtEx() to find specific text of arial in an area?

Thanks

Wanted

2010-09-05 16:30:33

LoadCharsFromFont2 is fixed in SCAR 3.25, but 3.25 is still a few days away from being fully ready for usage.

Dave

2010-09-05 16:32:01

From: IceFire908
LoadCharsFromFont2 is fixed in SCAR 3.25, but 3.25 is still a few days away from being fully ready for usage.


Really? Well the only reason I was going to switch to simba is because I couldn't get any of my scripts to work with scar using windows 7.

Will 3.25 work on windows 7 do you think?

Wizzup?

2010-09-05 16:34:58

From: IceFire908
LoadCharsFromFont2 is fixed in SCAR 3.25, but 3.25 is still a few days away from being fully ready for usage.


I think he was asking about Simba and not SCAR. :rolleyes: (It is the Simba section, remember?)

Davidude:


program new;
var
Font : TFont;
begin
Font := TFont.Create;
Font.Name := 'Courier New';
Font.Size := 10;
Font.Style := [];
LoadSystemFont(Font,'test');
DisplayDebugImgWindow(0,0);
DisplayDebugImgWindow(150,50);
DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
Font.free;
end.

For the text finding have a look at some of SRL's text finding functions. You'll mainly just want to create a Mask from the text using MaskFromText and FindBitmapMaskTolerance.

Wanted

2010-09-05 16:43:17

From: Dave
Really? Well the only reason I was going to switch to simba is because I couldn't get any of my scripts to work with scar using windows 7.

Will 3.25 work on windows 7 do you think?


Yes, SCAR has been ported to delphi 2010 so that it will work fully with windows 7 and vista now. There's been some setbacks porting to the new delphi but we are almost done working everything out.

From: Wizzup?
I think he was asking about Simba and not SCAR. :rolleyes: (It is the Simba section, remember?)


I answered half his question, and you answered the other half.

Perhaps you should just filter out the word SCAR from all of the srl website.

Wizzup?

2010-09-05 16:50:37

From: IceFire908
I answered half his question, and you answered the other half.

Perhaps you should just filter out the word SCAR from all of the srl website.


Shame, I figured you'd be more mature than the people you attacked all the time for posting Simba alternatives on SCAR threads…

E:
program new;
var
Font : TFont;

pelt : TMask;

x, y: integer;
w, h: integer;
begin
Font := TFont.Create;
Font.Name := 'Arial';
Font.Size := 8;
Font.Style := [];
if LoadSystemFont(Font,'test') then
writeln('Font loaded');

pelt := MaskFromText('mytext','test');
GetClientDimensions(w, h);

if FindMaskTolerance(pelt, x, y, 0, 0, w-1, h-1, 10, 10) then
begin
movemouse(x, y);
writeln('Found!');
end;

Font.Free;
end.

Wanted

2010-09-05 17:12:26

From: Wizzup?
Shame, I figured you'd be more mature than the people you attacked all the time for posting Simba alternatives on SCAR threads…


That's where you are wrong, there's a key difference. Although he specifically asked for help with simba, he mentioned SCAR several times in relevance I informed him accordingly rather than telling him to 'use only SCAR'.

Wizzup?

2010-09-05 17:14:58

From: IceFire908
That's where you are wrong, there's a key difference. Although he specifically asked for help with simba, he mentioned SCAR several times in relevance I informed him accordingly rather than telling him to 'use only SCAR'.


He never asked where SCAR was broken, he just said he was using Simba now. If people say ``I'm coming from SCAR but I am using Simba now'' I don't see it as an invitation to post about SCAR. But that's just my view, I guess.

Before you make another post here, please refer to the thread I deleted for you.
/Done

Wizzup?

2010-09-05 17:24:23

Quickly wrote an article about this on the Simba documentation.

Daniel

2010-09-06 03:11:56

From: IceFire908
There's been some setbacks porting to the new delphi but we are almost done working everything out.


We?

Camaro'

2010-09-06 11:30:13

[QUOTE=Dan's The Man;735305][i]We[/i]?[/QUOTE]

Yes, I think thats what he said.

Naum

2010-09-06 11:51:05

[QUOTE=Dan's The Man;735305][i]We[/i]?[/QUOTE]

Yup, just need to iron some more stuff out.

Ontopic: Nice documentation wizzup, is it only you who has edit access?

Wizzup?

2010-09-06 13:40:02

From: Naum
Yup, just need to iron some more stuff out.

Ontopic: Nice documentation wizzup, is it only you who has edit access?


You can edit and send me the new files / differences; http://git.villavu.com/?p=simba.git;a=tree;f=Doc/sphinx
Also, http://villavu.com/forum/showthread.php?t=58757