i tried to do DDTM's instead so iv read a few tuts and came up with this. but i can only get it to click the first dtm and not any of the others? i tried changing SetWalkDtm(1); to try and load all the other DDTMs but i cant seem to get it too work.
SCAR Code:
var Roadcolour: Integer;
Function SetWalkDtm(Number:Integer): Integer;
var MainPoint: TDTMPointDef; dtmSubPoints: Array [0..4] of TDTMPointDef; TempTDTM: TDTM; i: Integer;
begin
RoadColour := FindVarrockRoadColor;
case Number of
0:
begin
with MainPoint do
begin
x := 1012;
y := 102;
AreaSize := 4;
AreaShape := 0;
Color := RoadColour;
Tolerance := 5;
end;
dtmSubPoints[0].x := 1012;
dtmSubPoints[0].y := 102;
dtmSubPoints[1].x := 998;
dtmSubPoints[1].y := 104;
dtmSubPoints[2].x := 1014;
dtmSubPoints[2].y := 74;
dtmSubPoints[3].x := 1007;
dtmSubPoints[3].y := 75;
dtmSubPoints[4].x := 994;
dtmSubPoints[4].y := 90;
end;
1:
begin
with MainPoint do
begin
x := 1021;
y := 126;
AreaSize := 1;
AreaShape := 0;
Color := Roadcolour;
Tolerance := 5;
end;
dtmSubPoints[0].x := 1021;
dtmSubPoints[0].y := 126;
dtmSubPoints[1].x := 1014;
dtmSubPoints[1].y := 113;
dtmSubPoints[2].x := 1010;
dtmSubPoints[2].y := 138;
dtmSubPoints[3].x := 1027;
dtmSubPoints[3].y := 147;
dtmSubPoints[4].x := 1008;
dtmSubPoints[4].y := 113;
end;
2:
begin
with MainPoint do
begin
x := 1011;
y := 90;
AreaSize := 7;
AreaShape := 0;
Color := Roadcolour;
Tolerance := 5;
end;
dtmSubPoints[0].x := 1011;
dtmSubPoints[0].y := 90;
dtmSubPoints[1].x := 975;
dtmSubPoints[1].y := 148;
dtmSubPoints[2].x := 960;
dtmSubPoints[2].y := 140;
dtmSubPoints[3].x := 957;
dtmSubPoints[3].y := 94;
dtmSubPoints[4].x := 959;
dtmSubPoints[4].y := 114;
end;
end;
for i := 0 to High(dtmSubPoints) do
begin
dtmSubPoints[i].AreaSize := 1;
dtmSubPoints[i].AreaShape := 0;
dtmSubPoints[i].Color := RoadColour;
dtmSubPoints[i].Tolerance := 5;
end;
TempTDTM.MainPoint := MainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
and heres the part to make it walk:
SCAR Code:
function WalkToPlankGuy: Boolean;
var
WalkDTM: integer;
begin
WalkDTM := SetWalkDtm(0); <<<<<<<<< i tried changing these
if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then <<<< <<<
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Successfull!');
FFlag(3);
Result := True;
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;
end;
The only way i have come up with to get it too work is to just do lots of walking functions :S takes up lots of lines but it works ^^ please tell me if there is a simpler way