From my next section:
I'll just post some commented code for this one, I think there's only one usage of this procedure in SRL. And that is in the function GetMiniMapDotsIn:
SCAR Code:
{*******************************************************************************
function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
By: footballjds, NaumanAkhlaQ, Nava2 & Cazax
Description: Results the dots specified by WhatDot in x1, y1, x2, y2.
Usage : 'npc', 'yellow' : Yellow Dot;
'cape', 'blue' : Blue Dot;
'item', 'red' : Red Dot;
'player', 'white' : White Dot;
'friend', 'green' : Green Dot;
*******************************************************************************}
function GetMiniMapDotsIn(WhatDot: string; x1, y1, x2, y2: Integer): TPointArray;
var
Color: Integer;
begin
WhatDot := LowerCase(WhatDot);
case WhatDot Of
'npc', 'yellow': Color := 60909; //The one color
'cape', 'blue': Color := 12742980;// for FindColors is being setup here
'item', 'red': Color := 789758;
'player', 'white': Color := 16711422;
'friend', 'green': Color := 61440;
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
FindColorsSpiralTolerance(MMCX, MMCY, Result, Color, x1, y1, x2, y2, 0); //Finds all occurances of 'Color' this will search spiraling outwards from the MiniMap center.
RAaSTPA(Result, 4); //LOOK HERE > This will make one point per box on a player dot, great for counting.
if (Length(Result) < 1) then Exit; //Incase RAaSTPA sets Result as '0' due to no dots being found.
if (WhatDot = 'player') or (WhatDot = 'white') then //Necessary.
begin
InvertTPA(Result);
SetLength(Result, Length(Result) - 1);
InvertTPA(Result);
end;
end;
You see the prime usage of RAaSTPA is in this function, without it there would have been more lines of code, using this function makes it shorter. And remember the dots are round, so RAaSTPA accomodates that very nicely.