SRL Archive - SRL Archives

CompassRadialWalk;


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


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;

nielsie95

2007-04-29 17:23:46

This looks really nice :)
So basicly you need to set the compass perfect north, get some very close angles and it will work even if the compass is like West? :)

SKy Scripter

2007-04-30 13:41:49

This looks really nice
So basicly you need to set the compass perfect north, get some very close angles and it will work even if the compass is like West?


exactly dude…..

Wanted

2007-04-30 17:04:28

This is exactly what I've been looking for since AWalk2, good job dude.

SKy Scripter

2007-04-30 22:58:16

This is exactly what I've been looking for since AWalk2, good job dude.


finally, somone gets it jeeze this has been so helpful (to Me). My Golly…. :D

grindisbest

2007-05-28 08:27:04

Wow!!! I'm gonna have to try it out. Very good idea. Do you mind if I use it in scripts?

n3ss3s

2007-05-28 14:23:35

Seems like someone SKy Scripter is gonna get some Rep++
I know its sumting good but what exactly does that reputation do?

SKy Scripter

2007-05-29 02:50:07

Wow!!! I'm gonna have to try it out. Very good idea. Do you mind if I use it in scripts?

yup all my codes are free just credit me right….. :D

Seems like someone SKy Scripter is gonna get some Rep++
I know its sumting good but what exactly does that reputation do?


lol, i dont know what is ether, its probly good :p…..
lol i dont know what your talking about ether..

grindisbest

2007-05-29 06:28:17

Thank you!! Very useful indeed!!