SCAR Code:
procedure AngleWalk(Angle, Distance, Randomx, Randomy: Integer);
var
x, y, Degree: Extended;
begin
Randomx := Random(Randomx);
Randomy := Random(Randomy);
Degree := FixD(Angle - Round(Rs_GetCompassAngleDegrees * 56));
x := Distance * Cos(Degree * Pi / 180);
y := Distance * Sin(-Degree * Pi / 180);
Mouse(Round(x + 648), Round(y + 83), Randomx, Randomy, True);
end;
SCAR Code:
function AWalk2(Angle, Radius, Color, Tol: Integer): Boolean;
var
awx, awy, tout, Radius2, x1, y1: Integer;
CurrentMinimapAngle: Extended;
begin
Radius2 := Radius;
if (Radius = 0) or (Radius2 = 0) or (Radius > 57) or (Radius2 > 57) then
Radius2 := 57;
repeat
if (not LoggedIn) then
Exit;
Inc(tout);
CurrentMinimapAngle := Rs_GetCompassAngleDegrees;
if (CurrentMinimapAngle < 0) then
begin
WriteLn('Minimap not Found!');
Exit;
end;
X1 := Round(Radius2 * Sin((Pi / 180) * (CurrentMinimapAngle + Angle))) + MMCX;
Y1 := Round(-Radius2 * Cos((Pi / 180) * (CurrentMinimapAngle + Angle))) + MMCY;
MouseFindNoFlag(x1 - 2, y1 - 2, 4, 4);
if (not FlagPresent) then
begin
WriteLn('AWalk2 could not Click!');
Exit;
end;
FFLag(10);
awx := MMCX;
awy := MMCY;
until (FindColorSpiralTolerance(awx, awy, color, MMX1, MMY1, MMX2, MMY2, Tol)) or
(Tout > 20);
Result := True;
end;
SCAR Code:
procedure RotatePoint(var x, y: Integer);
var
x1, y1, r, Rad: Integer;
begin
Rad := Distance(MMCX, MMCY, x, y);
for r :=0 to 360 do
begin
x1:= Round(Rad * Sin(r * pi / 180)) + MMCX;
y1:= Round(-Rad * Cos(r * pi / 180)) + MMCY;
if(Distance(x1,y1,x,y)<=1)then
begin
x := Trunc(Rad * Sin((Pi / 180) * (Rs_GetCompassAngleDegrees + r)) + MMCX);
y := Trunc(-Rad * Cos((Pi / 180) * (Rs_GetCompassAngleDegrees + r)) + MMCY);
Exit;
end
end
end;
procedure RotatePointEx(var x, y: Integer; Angle: Integer);
var
Rad: Integer;
begin
Rad := Distance(MMCX, MMCY, x, y);
x := Trunc(Rad * Sin((Pi / 180) * (Rs_GetCompassAngleDegrees + Angle)) + MMCX);
y := Trunc(-Rad * Cos((Pi / 180) * (Rs_GetCompassAngleDegrees + Angle)) + MMCY);
end;
SCAR Code:
function MouseFindFlagAngle(x1, y1: Integer; angle: Integer): Boolean;
var
Xmod, Ymod: Integer;
begin
Mouse(x1, y1, 2, 2, True);
Wait(50);
if (not (FlagPresent)) then
begin
angle := angle - Round(Rs_GetCompassAngleDegrees);
Xmod := Round(2 * Sin(angle * Pi / 180));
Ymod := Round(-2 * Cos(angle * Pi / 180));
repeat
x1 := x1 + Xmod;
y1 := y1 + Ymod;
Mouse(x1, y1, 2, 2, True);
if (FlagPresent) then
begin
Result := True;
Break;
end;
until (x1 < 570) or (x1 > 725) or (y1 < 5) or (y1 > 160);
end;
end;
You might need to replace SCAR's Compass Function with SRL's, as the one in SCAR is broken (?).