From: Ashaman88
You should explain how you came to your solution so that others might benefit :)
True dat :D
function RadialWalkEx2(var TPA: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Variant; Radius: Integer): Boolean;
var
time: Integer;
SD, ED: extended;
begin
Result := False;
if (not LoggedIn) then Exit;
if not (VariantIsNumber(StartRadial) and VariantIsNumber(EndRadial)) then
begin
SD := variantToDirection(StartRadial);
StartRadial := SD;
ED := variantToDirection(EndRadial);
EndRadial := ED;
end else
begin
SD := StartRadial;
ED := EndRadial;
end;
if SD > ED then SwapE(SD, ED);
if (SD = ED) then
begin
srl_Warn('RadialWalkEx', 'StartRadial = EndRadial, using LinearWalkEx.', warn_Warning);
Result := LinearWalkEx(tpa, cx, cy, TheColor, tol, StartRadial, Radius);
end;
time := GetSystemTime;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 40, 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;
srl_Warn('RadialWalkEx', 'Took ' + IntToStr(GetSystemTime - time) +
' ms, found' + IntToStr(Length(TPA)) + ' points', warn_Debug);
end;
function RadialWalkTolerance2(Color: Integer; sRadial, eRadial: Variant; r, modX, modY, Tol: Integer): Boolean;
var
TPA: TPointArray;
i, h: Integer;
begin
Result := False;
if RadialWalkEx2(TPA, MMCX, MMCY, Color, Tol, sRadial, eRadial, r) then
begin
h := High(TPA);
for i := 0 to h do
//MFNF(TPA[i].x-5, TPA[i].y, modX, modY)
if BankTrue = 0 then
begin
if MouseFlagEx(TPA[i].x-5, TPA[i].y, 0, 0, modX, modY, -1, False, False) then
begin
Result := FFlag(30);
Exit;
end;
end else
begin
if MouseFlagEx(TPA[i].x, TPA[i].y, 0, 0, modX, modY, -1, False, False) then
begin
Result := FFlag(30);
Exit;
end;
end;
end;
end;
In RadialWalkEx function, there's this line
FilterPointsPie(tpa, SD, ED, 40, Radius, cx, cy);
I replaced the number to 40, so it is filtering the search result from radius 0 to 40.
You want to paste the function in your script. And if you're using another radialwalk function, you need to paste and edit the function in your script too.
In my case, I'm using RadialWalkTolerance. I paste the RadialWalkTolerance function in my script, then edit the RadialWalkEx inside the function into RadialWalkEx2. You need to rename both of the function to another name, else it will give you a duplicate error.
Not sure if I am right on this, but at least it works the way I want it now.