SRL Archive - SRL Archives

RadialWalkEx ++


Quickmarch

2009-06-19 20:06:28

Basically the same as RadialWalkEx but it takes the map angle into account:


function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
var
SD, ED: Integer;

begin
Result := False;
if (not LoggedIn) then Exit;
SD := Round(FixD(AdjustD(StartRadial, rs_GetCompassAngleDegrees)));
ED := Round(FixD(AdjustD(EndRadial, rs_GetCompassAngleDegrees)));
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
SortCircleWise(tpa, cx, cy, StartRadial, False, StartRadial > EndRadial);
Result := (Length(tpa) > 0);
except srl_Warn('RadialWalkEx', 'An exception has occured', warn_AllVersions); Exit; end;
end;

So which ever way the map is turned to, it will change the StartDegree and EndDegree accordingly.

Cazax

2009-06-19 20:08:32

while SD < 0 do IncEx(SD, 360);
while ED < 0 do IncEx(ED, 360);
while (SD > 360) do DecEx(SD, 360);
while (ED > 360) do DecEx(ED, 360);
Could be changed to:
SD := FixD(SD);
ED := FixD(ED);

Quickmarch

2009-06-19 20:09:07

From: Cazax
while SD < 0 do IncEx(SD, 360);
while ED < 0 do IncEx(ED, 360);
while (SD > 360) do DecEx(SD, 360);
while (ED > 360) do DecEx(ED, 360);
Could be changed to:
SD := FixD(SD);
ED := FixD(ED);


Oh, Added. :)

Naike

2009-06-19 22:36:54

Been made in the past, by some people(including me)…

Sorry to ruin the phun :/

Quickmarch

2009-06-19 22:38:04

Link please?

Naike

2009-06-19 23:28:25

http://www.villavu.com/forum/showthread.php?t=30894

^ Is just mine, theres some more..

ShowerThoughts

2009-06-19 23:53:56

That is perfect, no dtm's needed :D.