RWEx
and i found the same problem in LinearWalkEx
LinearWalkEx:
SCAR Code:
{*******************************************************************************
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; Direction: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from Radial (scanning outwards) for Radius Distance.
Valid Arguments:
tpa: Result points.
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
*******************************************************************************}
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; Direction: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
if Radius > 70 then Radius := 70;
i := GetSystemTime;
Direction := Direction mod 360;
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except srl_Warn('LinearWalkEx', 'LWex error!', warn_AllVersions); Exit; end;
// Uncomment this for debug
// WriteLn('LWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points: '+IntToStr(Length(tpa)));
end;
RadialWalkEx:
SCAR Code:
{*******************************************************************************
function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from StartRadial to EndRadial for Radius Distance.
Valid Arguments:
tpa: Result points.
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
*******************************************************************************}
function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
SD := StartRadial;
ED := EndRadial;
if Radius > 70 then Radius := 70;
if (SD = ED) then
begin
WriteLn('Using LinearWalkEx, equal values.');
Result := LinearWalkEx(tpa, cx, cy, TheColor, tol, StartRadial, Radius);
end;
if (SD > ED) then
Swap(SD, ED);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
if (not LoggedIn) then Exit;
i := GetSystemTime;
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;
// Uncomment this for debug
// WriteLn('RWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points: '+IntToStr(Length(tpa)));
end;
so if someone tries to make the radius too large or types in the radius wrong then it wont end up messing up the script
therefore it will change the radius so it wont be too large and mess up the script
~shut