RadialTPAWalk - guess by who...
MinPix - how many pixels a square of the color must contain
SR, ER - StartRadial, EndRadial
MinD, MaxD - min distance, max distance
Color - the color to walk "at".
This function is compass angle independent, you don't need to do anything to the angles yourself or worry about the angle shifting...
SCAR Code:
Function RadialTPAWalk(Color: Integer; MinPix, SR, ER, MinD, MaxD: Integer): Boolean;
Var
TPAA: Array of TPointArray;
X, Y, Z, I, S, E: Integer;
TPA: TPointArray;
Begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, 0);
FilterPointsPie(TPA, 0, 359, MinD, MaxD, MMCX, MMCY);
TPAA := TPAToATPA(TPA, Round(Sqrt(MinPix)));
S := SR + Round(Rs_GetCompassAngleDegrees);
E := ER + Round(Rs_GetCompassAngleDegrees);
If S > 360 Then S := S - 315;
If E > 360 Then E := E - 315;
Writeln(IntToStr(S));
Writeln(IntToStr(E));
For I := 0 To High(TPAA) Do
Begin
MiddleTPAEx(TPAA[i], X, Y);
Z := Round(Degrees(ArcTan2(MMCY - Y, MMCX - X))) - 90;
If Z < 0 Then
Z := Z + 360;
If Z > SR Then
If Z < ER Then
Begin
MouseFindFlag(X, Y, 1, 1);
Flag;
Result := True;
Exit;
End;
End;
End;