well this doesn't have to do with your problem, but this will be a problem for you once you get that fixed, you have no tolerance on your DDTM points, and no size, and don't you think that 8 subpoints is a little too much? And maybe if your finding the DDTM on the minimap you should use FindDTMRotated instead of just FindDTM (Scar can find the DTM easier), and as for the line 9 thing,
SCAR Code:
procedure WalkingToStore;
begin
function LoadAllDTMWalks(WalkNumber: Integer): Integer;
Thats your problem, you call on a procedure, and you don't end it, and you start a new function, You can't have another function/procedure inside a function/procedure, thats your error, your script should look something like this,
SCAR Code:
program BucketBuyer;
{.include SRL/SRL.scar}
var
x,y:integer;
function LoadAllDTMWalks(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..7] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin
dtmMainPoint.x := 839;
dtmMainPoint.y := 271;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindRoadColor;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 839;
dtmSubPoints[0].y := 271;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindRoadColor;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 837;
dtmSubPoints[1].y := 257;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindRoadColor;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 839;
dtmSubPoints[2].y := 291;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindRoadColor;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 843;
dtmSubPoints[3].y := 287;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindRoadColor;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 835;
dtmSubPoints[4].y := 275;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindRoadColor;
dtmSubPoints[4].Tolerance := 0;
dtmSubPoints[5].x := 828;
dtmSubPoints[5].y := 258;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := FindRoadColor;
dtmSubPoints[5].Tolerance := 0;
dtmSubPoints[6].x := 834;
dtmSubPoints[6].y := 259;
dtmSubPoints[6].AreaSize := 0;
dtmSubPoints[6].AreaShape := 0;
dtmSubPoints[6].Color := FindRoadColor;
dtmSubPoints[6].Tolerance := 0;
dtmSubPoints[7].x := 837;
dtmSubPoints[7].y := 277;
dtmSubPoints[7].AreaSize := 0;
dtmSubPoints[7].AreaShape := 0;
dtmSubPoints[7].Color := FindRoadColor;
dtmSubPoints[7].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;
function WalkingToStore: 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, 5, 5, True);
WriteLn('Walk Succesfull.');
FFlag(0);
Result := True; // If succesfully finds it will click it and wait to flag is gone.
end;
end;
begin
SetupSRL;
Activateclient;
WalkingToStore;
end.
I Fixed it up a bit, added standards, hope that helped and you can understand all that (I'm not the best at helping),
-Blumblebee