Using FindDTMRotated will easily solve the MM-degree problem.
I made a "sketch" you could try and perfect. It knows when it's north, but it has problems with south and middle and middle-south.
SCAR Code:
Function FDTMR(DTM: Integer): Boolean;
var
a,b: Integer;
E: Extended;
begin
Result:= FindDTMRotated(DTM,a,b,MMx1,MMy1,MMx2,MMy2,-30,30,0.1,E)
MMouse(a,b,0,0)
end;
Function GetCowPenPosition: String;
var
RockTree,TwoTrees,TreePalm: Integer; // DTMs
begin
RockTree := DTMFromString('78DA63EC646260D0654001CE1E1E0C22409A1' +
'1CA67AC00AA9143551361C885A94606558D41820AAA9A3222D454' +
'01D5C812505341A439D2F8D50000152809C5');
TwoTrees := DTMFromString('78DA63CC636660B06064400611865C0C1A401' +
'A26CA9805546348404D26508D1EAA1A8304155435D944A8C905AA' +
'3125A0A680B01A00CA6708C3');
TreePalm := DTMFromString('78DA635CCCC4C060CD8002A40258193480342' +
'394CF3811A8C61B558D41820AAA9AC940359E04D4F41361CE24C2' +
'6A0018C20869');
if FDTMR(RockTree) and FDTMR(TwoTrees) then Result:= 'Middle-South'
if Length(Result) = 0 then if FDTMR(TwoTrees) and FDTMR(TreePalm) then Result:= 'Middle-North'
if Length(Result) = 0 then
begin
if FDTMR(RockTree) then Result:= 'South'
else if FDTMR(TwoTrees) then Result:= 'Middle'
else if FDTMR(TreePalm) then Result:= 'North'
end;
FreeDTM(RockTree)
FreeDTM(TwoTrees)
FreeDTM(TreePalm)
end;
The DTMs need a bit of work.
-Knives