From: Brandon
What? It returns the actual angle not the inverse :S
Then it converts it to radians.
Ugg yeah, dunno what i was talking.
But the degArray is an empty array of length 1 when 'foundIndex := inArray(tmp,degArray)' is called?
From: Brandon
Change the coords and colours and it should work. Perhaps even use a different CTS. I did this based off that picture on the OP.
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
Function GetBoxMinimap: TBox;
var
TPA: TPointArray;
ATPA: T2DPointArray;
Begin
FindColorsTolerance(TPA, 7433839, MMBox.X1, MMBox.Y1, MMBox.X2, MMBox.Y2, 25);
If (Length(TPA) < 1) Then Exit;
ATPA := FloodFilLTPA(TPA);
If (Length(ATPA) < 1) Then Exit;
SortATPAFromFirstPoint(ATPA, Point(300, 300)); //Middle Of MM.
Result := GetTPABounds(ATPA[0]);
End;
var
F: TBox;
begin
SetupSRL;
F := GetBoxMinimap;
MMouse(F.X1, F.Y1, 0, 0);
Wait(1500);
MMouse(F.X2, F.Y2, 0, 0);
end.
What does FloodFillTPA do? Difference between it and SplitTPA/TPAtoATPA?
No time to ponder through those 100 lines of code now so would you mind giving me a brief description? :)
Anyway i tried the code, the result is almost there:

May be able to fix it if i understand FloodFillTPA.
I kept thinking about the black pixel and white outline earlier on, totally forget about the grey ground.
Just tried using SplitTPA to get the larger path first, then
SortTPAByX(ATPA[0], true);
TPAtoATPAExWrap(ATPA[0], 40, 50, ATPA);
Came up with what i wanted, but will be another hour of work to make it compass compatible and work with different areas..

Thanks for the help, repped :)