Well. I get this error when testing a ddtm:
SCAR Code:
[Runtime Error] : Exception: Access violation at address 00721002 in module 'scar.exe'. Read of address 00000000 in line 56 in script C:\Program Files (x86)\SCAR 3.20\Scripts\dtm tester.scar
in this test script taken from Bobbo's ddtm tut:
SCAR Code:
program NewScript;
{.include SRL/SRL.scar}
var
x,y:integer;
function LoadAllDTMWalks(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin //Walk To mine Begins
dtmMainPoint.Areashape := 0;
dtmMainPoint.Areasize := 0;
dtmMainPoint.Color := 6513258;
dtmMainPoint.Tolerance := 0;
dtmMainPoint.x := 675;
dtmMainPoint.y := 92;
dtmSubPoints[0].Areashape := 0;
dtmSubPoints[0].Areasize := 0;
dtmSubPoints[0].Color := 6513258;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[0].x := 676;
dtmSubPoints[0].y := 98;
dtmSubPoints[1].Areashape := 0;
dtmSubPoints[1].Areasize := 0;
dtmSubPoints[1].Color := 6513258;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[1].x := 673;
dtmSubPoints[1].y := 88;
dtmSubPoints[2].Areashape := 0;
dtmSubPoints[2].Areasize := 0;
dtmSubPoints[2].Color := 6513258;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[2].x := 669;
dtmSubPoints[2].y := 98;
dtmSubPoints[3].Areashape := 0;
dtmSubPoints[3].Areasize := 0;
dtmSubPoints[3].Color := 6513258;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[3].x := 684;
dtmSubPoints[3].y := 94;
end;
end;
end;
function WalkToSomewhere: Boolean;
var
WalkDTM: integer; // Calls the WalkDTM making walking simpler.
begin
WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True; // If succesfully finds it will click it and wait to flag is gone.
end else // else it will do this...
if RadialWalk(FindFallyRoadColor, 300, 220, 55, 1, 1) then
begin
Writeln(' Walk Backup 1. - Complete.');
Result := True; //Will look for this if DDTM fails, if this fails then logsout, but you can change that.
end else
begin
Result := False;// cant find the backup goes here...
Writeln(' Walk Backup 1. - Failed. Logging Out.');
FreeDTM(WalkDTM); // FREEs the DDTM so you dont have a memory overload :P
if not (Result) then //if doesnt get results does this
begin
Logout; // logs out.
end;
end;
end;
Procedure Setup;
begin
SetupSRL;
ActivateClient;
end;
begin
Setup;
Walktosomewhere;
end.
Anyone have any ideas on what the error is?
~Des