SRL Archive - Test corner

Checking for accuracy!


Wanted

2007-07-07 23:44:42

Ok, I need everyone's opinion on this, which works more accurately?

The first one uses RS_GetMiniMapAngle, the second uses RS_GetCompassAngleDegrees.

First one is called MMAWalk, the second one is called CAWalk.

Please, if you test, play with it from the same spot over and over again and see which one really works better/ vote.

program AccuracyTest;

{.Include SRL/SRL.SCAR}

{*******************************************************************************
function MMAWalk(Angle, Radius, RanX, RanY: LongInt): Boolean;
By: IceFire908.
Description: Walks in the same direction regardless of what angle the Mini-Map is.
Note: 0 = N, 90 = E, 180 = S, 270 = W, adjust and test for further accuracy.
*******************************************************************************}

function MMAWalk(Angle, Radius, RanX, RanY: LongInt): Boolean;
var
OMS: Integer;
MMAW: TPoint;
begin
if (not (LoggedIn)) then Exit;
OMS := MouseSpeed;
MouseSpeed := 0;
MMAW.X := Round(Radius * Sin((Pi / 180) * FixD(RS_GetMiniMapAngle + Angle)) + MMCX);
MMAW.Y := Round(-Radius * Cos((Pi / 180) * FixD(RS_GetMiniMapAngle + Angle)) + MMCY);
if (RS_OnMinimap(MMAW.X, MMAW.Y)) then
begin
Result := True;
Mouse(MMAW.X, MMAW.Y, RanX, RanY, True);
FFlag(10);
end else
WriteLn('ERROR: That point is not on the Mini-Map.');
MouseSpeed := OMS;
end;

{*******************************************************************************
function CAWalk(Angle, Radius, RanX, RanY: LongInt): Boolean;
By: IceFire908.
Description: Walks in the same direction regardless of what angle the Compass is.
Note: 0 = N, 90 = E, 180 = S, 270 = W, adjust and test for further accuracy.
*******************************************************************************}

function CAWalk(Angle, Radius, RanX, RanY: LongInt): Boolean;
var
OMS: Integer;
CAW: TPoint;
begin
if (not (LoggedIn)) then Exit;
OMS := MouseSpeed;
MouseSpeed := 0;
CAW.X := Round(Radius * Sin((Pi / 180) * FixD(RS_GetCompassAngleDegrees + Angle)) + MMCX);
CAW.Y := Round(-Radius * Cos((Pi / 180) * FixD(RS_GetCompassAngleDegrees + Angle)) + MMCY);
if (RS_OnMinimap(CAW.X, CAW.Y)) then
begin
Result := True;
Mouse(CAW.X, CAW.Y, RanX, RanY, True);
FFlag(10);
end else
WriteLn('ERROR: That point is not on the Mini-Map.');
MouseSpeed := OMS;
end;

begin
SetUpSRL;
ActivateClient;
Wait(3000);
MMAWalk(8, 28, 1, 1);
//CAWalk(8, 28, 1, 1);
end.

Thanks,

-IceFire.