Metagen
2008-07-04 23:28:57
Procedure I wrote, I think it would benifit many scripters.
{*******************************************************************************
Procedure MakeCompassToPoint(cx, cy : Integer);
By: Metagen
Description: Turns the compass to point towards a set of coordinates on the
minimap
*******************************************************************************}
procedure MakeCompassToPoint(cx, cy : Integer);
begin
If not loggedin then exit;
if not rs_OnMinimap(cx, cy) then
begin
writeln('Point not on minimap');
exit;
end;
if cx > MMCX then
if cy >= MMCY then
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - (90 + degrees(ArcTan((cy-MMCY) div (cx-MMCX)))))));
else
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - (90 + degrees(ArcTan((cy-MMCY) div (cx-MMCX)))))));
else if cx < MMCX then
if cy >= MMCY then
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - (270 + degrees(ArcTan((cy-MMCY) div (cx-MMCX)))))));
else
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - (270 + degrees(ArcTan((cy-MMCY) div (cx-MMCX)))))));
else
if cy >= MMCY then
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - 180)));
else
MakeCompass(inttostr(Round(rs_GetCompassAngleDegrees - 0)));
end;