SRL Archive - Other Scripts

Read letters and type


t4q

2009-05-15 22:20:06

Hi, I'm going to make script that reads painted letters and then types those. Those letters differ little from each other (example: "L" can be rotated or deformed). I know i have to change BMPs in Fonts folder.
I read Scar Help and got some ideas from there.
Any thoughts?

Floor66

2009-05-15 22:24:32

FindBitmapDeformed exists.

t4q

2009-05-15 23:29:07

I tested that but got error :confused:
Line 13: [Error] (16220:1): Type mismatch in script

program New;
{.include SRL\SRL.scar}
var x, y, dd, acc: Integer;
procedure load;
begin
dd := LoadBitmap('.\dd.bmp');
end;

procedure click;
begin
if
FindDeformedBitmapToleranceIn(dd, x, y, 0, 0, 800, 800, 70, 3, True, acc)
then
Clickmouse(x,y,true);
begin
repeat
load;
Wait(2000);
click;
until(false)
end.

Floor66

2009-05-15 23:42:16

You have to first Load the bitmap before looking for it.

Try this:

program New;
{.include SRL\SRL.scar}

var
x, y, dd: Integer;
acc : Extended;

procedure load;
begin
dd := LoadBitmap('.\dd.bmp');
end;

begin
if FindDeformedBitmapToleranceIn(dd, x, y, 0, 0, 800, 800, 70, 3, True, acc) then
begin
repeat
Wait(2000);
Clickmouse(x,y,true);
until(false);
end;
end.

t4q

2009-05-16 11:48:40

Got that error..
[Runtime Error] : Exception: Access violation at address 006D5D0B in module 'scar.exe'. Read of address 00000000 in line 9 in script
Searched forums but didnt find solution for this.
i got similar problems with DTM's before. Then my DTM's were too small.

Floor66

2009-05-16 12:25:45

In SCAR use Tools > Picture to String instead of LoadBitmap.

Naum

2009-05-17 21:30:23

Lol.. its easy

program New;
{.include SRL\SRL.scar}

var
x, y, dd: Integer;
acc : Extended;

procedure load;
begin
dd := LoadBitmap('.\dd.bmp');
end;

begin
load;
if FindDeformedBitmapToleranceIn(dd, x, y, 0, 0, 800, 800, 70, 3, True, acc) then
begin
repeat
Wait(2000);
Clickmouse(x,y,true);
until(false);
end;
end.

you have to load it first using that procedure :p