SCAR Code:
function GoToField : boolean;
var
x, y, DTM : integer;
angle : extended;
spots : TPointArray;
spts : Tpoint;
begin
Status('Going to flax field');
MakeCompass('n');
SetAngle(True);
if InBank then
begin
RunOrNot;
GameTab(4);
DTM := SetToField1;
if FindDTMRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, radians(-35),
radians(35), 0.06, angle) then
begin
FreeDTM(DTM);
MouseFlag(x, y, 4, 4);
end else FreeDTM(DTM);
DTM := SetToField2;
if FindDTMRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, radians(-35),
radians(35), 0.06, angle) then
begin
FreeDTM(DTM);
MouseFlag(x, y, 4, 4);
end else FreeDTM(DTM);
//FindSymbolIn(x, y, 'rare trees', MMCY, MMX1, 661, 145);
//MouseFlag(x+8+random(6), y+5+random(7), 6, 6);
FindColorsTolerance(spots, 10444893, MMx1, MMy1, MMx2, MMy2, 35);
if not(GetArrayLength(spots) > 5) then
begin
MouseFlag(643+random(8), 125+random(6), 25, 25);
FindColorsTolerance(spots, 10444893, MMx1, MMy1, MMx2, MMy2, 35);
end;
spts := MiddleTPA(spots);
MouseFlag(spts.x, spts.y, 5, 5);
Result := (GetArrayLength(spots) >= 5);
end;
end;