Im trying to walk to a DDTM on the minimap but SCAR cant find the DDTM.
I have made a script that walks fine using DDTMs but its not working for me now.
Here is the DDTM:
SCAR Code:
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 712;
dtmMainPoint.y := 157;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindTreeColor;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 712;
dtmSubPoints[0].y := 157;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindTreeColor;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 725;
dtmSubPoints[1].y := 156;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindTreeColor;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 695;
dtmSubPoints[2].y := 166;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindTreeColor;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 720;
dtmSubPoints[3].y := 161;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindTreeColor;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
My FindTreeColor function works fine but if you wana see it here it is:
SCAR Code:
function FindTreeColor: Integer;
var
TPA : TPointArray;
I, H, Col : Integer;
begin
FindColorsTolerance(TPA, 18205, MMX1, MMY1, MMX2, MMY2, 20);
H := RandomRange(0,5);
for I := H to H do
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Tree Color:'+IntToStr(Col));
end;
end;
Here is my procedure for finding the DDTM:
SCAR Code:
if DTMRotated(SetDDTM,x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Writeln('Found');
Flag;
Wait(500+Random(250));
end;
Im using (D)DTM Editor by Nielsie95
It should be finding some trees under Fally above the cow pen.
Anything that Im doing wrong?