SKy Scripter
2007-04-24 02:02:00
ok, this might not make sense but i notice in radialroadwalk;
when i turn the mini map it would not click the same spot…
so this really started to get on my nerves ! i would have to leave
my compass the same direction every time well, with this function you don't.
Example :
CompassRadialWalk(RoadColor, 0, 180, 60); // scan left side
CompassRadialWalk(RoadColor, 180, 0, 60); // Scan Right Side
CompassRadialWalk(RoadColor, 0, 360, 60); // Scan All Around
when i turn the mini map it would not click the same spot…
so this really started to get on my nerves ! i would have to leave
my compass the same direction every time well, with this function you don't.
Example :
CompassRadialWalk(RoadColor, 0, 180, 60); // scan left side
CompassRadialWalk(RoadColor, 180, 0, 60); // Scan Right Side
CompassRadialWalk(RoadColor, 0, 360, 60); // Scan All Around
Function CompassRadialWalk(Color, StartRadial, EndRadial, Radius: Integer): Boolean;
var
i, xx, yy: Integer; // Sky Scripter
begin // Based off of WT-Fawki and Wizzup? Radial Walk
if (StartRadial < EndRadial) then
begin
repeat
for i := StartRadial to EndRadial do
begin
xx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 646);
yy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 84);
if (FindColor(x, y, Color, xx, yy, xx + 1, yy + 1)) then
begin
MouseFindNoFlag(x, y, -1, 1);
Result := True;
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end;
if (StartRadial > EndRadial) then
begin
repeat
for i := StartRadial downto EndRadial do
begin
xx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 646);
yy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 84);
if (FindColor(x, y, Color, xx, yy, xx + 1, yy + 1)) then
begin
MouseFindNoFlag(x, y, -1, 1);
Result := True;
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end
end;
Function CompassRadialWalkEx(Var P : TPoint; Color, StartRadial, EndRadial, Radius: Integer): Boolean;
var
i, xx, yy: Integer; // Sky Scripter
begin // Based off of WT-Fawki and Wizzup? Radial Walk
if (StartRadial < EndRadial) then
begin
repeat
for i := StartRadial to EndRadial do
begin
xx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 646);
yy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 84);
if (FindColor(x, y, Color, xx, yy, xx + 1, yy + 1)) then
begin
P.x:= x;
P.y:= y;
Result := True;
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end;
if (StartRadial > EndRadial) then
begin
repeat
for i := StartRadial downto EndRadial do
begin
xx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 646);
yy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + i)) + 84);
if (FindColor(x, y, Color, xx, yy, xx + 1, yy + 1)) then
begin
P.x := x;
P.y := y;
Result := True;
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end
end;
//--------------------------------------------------------\\
{ fixes the coords to the direction needed
for example: say you want to find a ladder but want to make the
coords 30 pixels north, it will fix the coords pointing
north even if your compass if facing another direction
Example:
If (FindLadder(x, y)) then
begin
FixCoords(x, y, Random(5) - Random(5), 10 + random(2));
Mouse(x, y, 0, 0, True);
Flag;
end;
this would fix the coords pointing north :) }
//------------------------------------------------------\\
Procedure FixCoords(Var x, y: Integer; Deg, Radius : Integer);
begin // Sky Scripter
x:= Trunc(Radius * Sin((Pi/180) * (Rs_GetCompassAngleDegrees + Deg)) + x);
y:= Trunc(-Radius * Cos((Pi/180) * (Rs_GetCompassAngleDegrees + Deg)) + y);
end;