JuKKa
2007-04-27 14:43:19
::::::::::NEW UPDATE::::::::::
It now takes the shortest way!
its perfect (for me)
request from nielsie:
havent tested in game but should work..
It now takes the shortest way!
procedure SetCompass(Direction: String);
var
Angle,DirectionDeg: Extended;
var
WhichKey: Integer;
begin
case Direction of
'n': DirectionDeg := 0;
'w': DirectionDeg := 90;
'e': DirectionDeg := 270;
's': DirectionDeg := 180;
end
Angle:= rs_GetCompassAngleDegrees;
if Angle = DirectionDeg then exit;
if Angle > 180 then
WhichKey := VK_RIGHT;
if Angle < 180 then
WhichKey := VK_LEFT;
KeyDown(WhichKey)
repeat
if not loggedin then break;
Angle:= rs_GetCompassAngleDegrees;
wait(1);
until(Angle = DirectionDeg);
KeyUp(WhichKey)
end;
its perfect (for me)
request from nielsie:
procedure SetCompassDegrees(Degre: Extended);
var
Angle: Extended;
begin
KeyDown(VK_RIGHT)
repeat
if not loggedin then break;
Angle:= rs_GetCompassAngleDegrees;
wait(1);
until(Angle = Degre);
KeyUp(VK_Right)
end;
havent tested in game but should work..