XcanadamanX
2007-11-29 19:00:56
Well here it is not to complicated. so far it has worked perfectly in Al Kharid. it works in any direction. just make sure its close to the angle before you call this. it is like someone elses (sorry cant remember on the top of my head) but mine uses the angle the dtm is found at. the accuracy's can be changed to your liking.
usage:
Procedure AlignMM;
var DTM,x,y,i:integer;
acc:extended;
begin
DTM := DTMFromString('78DA634C676260086240016F9F7C641001D28' +
'C40FC1F0818416AFC71AB0101B09A7022D44413A1C60BBF1A009F' +
'1015DF');
wait(50)
if FindDtmRotated(DTM,x,y,MMX1,MMY1,MMX2,MMY2,radians(-40),radians(40),0.01,acc) then
begin
if (acc < 0.1) and (acc > -0.1) then
exit
else
begin
repeat
If FindDtmRotated(DTM,x,y,MMX1,MMY1,MMX2,MMY2,radians(-40),radians(40),0.01,acc) then
begin
if acc < 0 then
begin
KeyDown(VK_RIGHT)
Wait(20+random(10))
KeyUp(VK_RIGHT)
end;
if acc > 0 then
Begin
KeyDown(VK_LEFT)
Wait(20+random(10))
KeyUp(VK_LEFT)
end;
if acc = 0 then break;
end else
exit;
wait(20)
Inc(i)
until (((acc < 0.1) and (acc > -0.1)) or (i > 25))
end;
end;
freeDtm(DTM)
end;usage:
begin
makecompass('w')
AlignMM
end;