Ok well you didn't "include" SRL right... you don't use normal comment marks
you use the big block comment marks
and right after the first { you need a .
SCAR Code:
program New;
{.include SRL\SRL.scar }
var
x, y: Integer;
Lobster: Integer; //DTM
begin;
//start load
Lobster := DTMFromString('78DA6314656060E067400165D1E60CBF80342' +
'310FF0702464520838F010D302291409A1348B01350C302240409' +
'A8E10212E204D4C8000931026A248104337E3500BE2106FA');
//load ended. Use DTM now
if FindDTM(Lobster, x, y, 100, 100, 250, 300) then //finds DTM
begin
Mouse(x, y, 1, 1, true); //clicks DTM(SRL)
WriteLn('Clicked Lobster.');
end else
begin
WriteLn('Didnt find Lobster');
end;
end.
Also for good practice I recommened you add an end else thing in there like above.
And your standards where slightly off, 2 spaces after a begin. Even if you have a long line of things to do.
Also And You should just get into the habbit of seperrating the things into procedures and the main loop.
SCAR Code:
program New;
{.include SRL\SRL.scar }
var
x, y: Integer;
Lobster: Integer; //DTM
procedure LoadDTM;
begin
//start load
Lobster := DTMFromString('78DA6314656060E067400165D1E60CBF80342' +
'310FF0702464520838F010D302291409A1348B01350C302240409' +
'A8E10212E204D4C8000931026A248104337E3500BE2106FA');
end;
//load ended. Use DTM now
procedure ClickDTM;
begin
if FindDTM(Lobster, x, y, 100, 100, 250, 300) then //finds DTM
begin
Mouse(x, y, 1, 1, true); //clicks DTM(SRL)
WriteLn('Clicked Lobster.');
end else
begin
WriteLn('Didnt find Lobster');
end;
end;
Begin
SetupSRL;
LoadDTM;
ClickDTM;
end.
You should free the DTM/bitmap from memory by using FreeDTM(DTMName) and FreeBitmap(BMPName), respetivly.