Log in

View Full Version : need a lil help again plz



Scaper
06-05-2008, 12:51 AM
ok when im trying to find DTM i find the bank dtm then when i go to find the tree dtm i get this error why plz..??

SRL Compiled in 20 msec
found bank dtm
[Runtime Error] : Exception: Access violation at address 006D691C in module 'scar.exe'. Read of address 00000000 in line 73 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Color.scar

thius is the color.scar

function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
var
t, s, AngleFound: Extended;
begin
if (FindDTM(DTM, x, y, x1, y1, x2, y2)) then//<------------Line73???
begin
Result := True;
Exit;
end;
repeat
s := 0.3;
repeat
if (FindDTMRotated(DTM, x, y, x1, y1, x2, y2, 0 - t, 0 + t, s, AngleFound)) then
begin
Result := True;
Exit;
end;
s := s - 0.1;
until (s <= 0.1);
t := t + (Pi / 20);
until (t >= Pi / 3);
end;

and my tree procedure..??

procedure gettotree;
begin
MakeCompass('N');
wait(1000);
if DTMRotated(Tree, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln ('found Tree dtm');
wait(1000)
Mouse(x, y, -5, -5, true);
FFlag(0);
end;
FreeDTM(Tree);
end;

any help plz thanx in advance scaper

Dusk412
06-05-2008, 01:07 AM
you just need to set what your dtm, Tree, is somewhere in the script. So do somethin like this.

procedure gettotree;
begin
Tree := DTMFromString('78DA637CC7C4C0F089010504251A31FC07D 28' +
'C40FC1F0818AF02D5FC405593E0CACE20095503028C97806A 1819' +
'51D484F909A2AA790354C301E1C1C454E2B819E490D5DC00A A116' +
'5C46B170052C50F5D');
MakeCompass('N');
wait(1000);
if DTMRotated(Tree, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln ('found Tree dtm');
wait(1000)
Mouse(x, y, -5, -5, true);
FFlag(0);
end;
FreeDTM(Tree);
end;

Cazax
06-05-2008, 01:07 AM
Do you load the DTM before using it?

Scaper
06-05-2008, 01:28 AM
here this is what im doing..?? point me in the right direction plz..??

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

var x, y, Bankdtm, TreeDTM, bankers,Bank,tree: integer;

procedure loadDTMs;
begin
BankDTM := DTMFromString('78DA637CCEC4C020CCC8800C5E1D6703D33 05' +
'1C6A74035DCA86A18191951D5BC04AA9124A0E61D508D2001 350F' +
'816A4409A8790054234040CD1BA01A71FC6A00749408C1');
TreeDTM := DTMFromString('78DA637CCEC4C0F08401053097338269462 89' +
'FF12150CD0354358C8C686A40E6DC25A0E61D50CD63026A5E 01D5' +
'BC22A0E61150CD4BFC6A0094770B63');

end;

procedure GetInToBank;
begin
MakeCompass('S');
wait(1000);
if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln ('found bank dtm');
wait(1000)
Mouse(x, y, 5, 5, true);
FFlag(0);
end;
FreeDTM(Bank);
end;

procedure gettotree;
begin
MakeCompass('N');
wait(1000);
if DTMRotated(Tree, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln ('found Tree dtm');
wait(1000)
Mouse(x, y, 766, 186, true);
FFlag(0);
end;
FreeDTM(Tree);
end;

procedure SetUp;
begin
ActivateClient;
setAngle(true);
SetRun(True);
LoadDTMs;
end;



begin
SetUpSRL;
SetUp;
repeat
GetInToBank;
getToTree;
until(True);
begin
Writeln('we are at bank')
Terminatescript;
end;
end.
thanx

Method
06-05-2008, 01:30 AM
You need to call loadDTMs; before you try finding the tree. Plus, Bankers isn't a DTM in the script (you may have meant BankDTM instead?) so you won't find the bank either.

Scaper
06-05-2008, 01:44 AM
ok im a lil stuck and tired so were would i call this b4..?

Method
06-05-2008, 01:52 AM
Oh, nevermind. You actually did call loadDTMs in your Setup procedure. If that's the case, I'm not really sure why that would be happening other than you not naming the Bankers DTM right (Bankers vs. BankDTM).

Dusk412
06-05-2008, 02:00 AM
Also Tree vs TreeDTM.

itSchRis917
06-05-2008, 02:44 AM
It should be TreeDTM not tree.

EDIT: 900th post! W00t!