SRL Archive - SRL Archives

MapWalk.scar small thing.


Naike

2009-06-19 14:33:55

Shorten RadialRoadWalk and LinearRoadWalk.

New ones

{*******************************************************************************
function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Nielsie95
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance
Valid Arguments:
TheColor: RoadColor. RoadColor will be dynamically updated.
StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}
function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
begin
Result := False;
if (not LoggedIn) then Exit;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));

Result := RadialWalk(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod);
If Result then
RoadColorChecker;
end;


{*******************************************************************************
function LinearRoadWalk(TheColor: Integer; Direction: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Nielsie95
Description: Walks TheColor from Direction MIDDLE OUT!by performing windscreenlike scanning movements for Radius Distance
Valid Arguments:
TheColor: Any Color, but Road- or WaterColor will do fine :)
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}
function LinearRoadWalk(TheColor: Integer; Direction: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
begin
Result := False;
if (not LoggedIn) then Exit;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));

Result := LinearWalk(TheColor, Direction, Radius, Xmod, Ymod);
If Result then
RoadColorChecker;
end;

Old ones

{*******************************************************************************
function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Nielsie95
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance
Valid Arguments:
TheColor: RoadColor. RoadColor will be dynamically updated.
StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}

function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
CountFlag(10);
Result := True;
Break;
end;
end;


{*******************************************************************************
function LinearRoadWalk(TheColor: Integer; Direction: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Nielsie95
Description: Walks TheColor from Direction MIDDLE OUT!by performing windscreenlike scanning movements for Radius Distance
Valid Arguments:
TheColor: Any Color, but Road- or WaterColor will do fine :)
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}

function LinearRoadWalk(TheColor: Integer; Direction: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if LinearWalkEx(tpa, MMCX, MMCY, TheColor, 0, Direction, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
CountFlag(10);
Result := True;
Break;
end;
end;

Nava2

2009-06-20 02:36:15

/thread

Sorry, can't be done.

I cleared this up via IRC with N1ke. :)

Wizzup?

2009-06-20 03:23:53

So what did you clear up then?

Naike

2009-06-20 14:56:42

Wizzup?, long story short: RoadColorChecker needs to be repeated and not run once.

Thinking of doing a smarter way, but I don't think it be appreciated ^^