m34tcode
2012-05-17 19:50:17
(*
FindMultipleColors
~~~~~~~~~~~
.. code-block:: pascal
function FindMultipleColors(var ATPA : T2DPointArray; Colors: TIntegerArray; SearchBox : TBox; Tolerance : Integer) : Boolean;
Returns the result of multiple calls of FindColorsTolerance in an ATPA
.. note::
Author: m34tcode
Last Modified: 5/17/12 by m34tcode
Example:
.. code-block:: pascal
FindMultipleColors(ATPA,[16777215,4539717],InvBox(5),10);
Smart_DrawDots(MergeATPA(ATPA));
*)
function FindMultipleColors(var ATPA : T2DPointArray; Colors: TIntegerArray; SearchBox : TBox; Tolerance : Integer) : Boolean;
var
I : Integer;
begin
Result := False;
SetArrayLength(ATPA,Length(Colors));
for I := 0 to High(Colors) do
begin
if FindColorsTolerance(ATPA[I],Colors[I],SearchBox.X1,SearchBox.Y1,SearchBox.X2,SearchBox.Y2,Tolerance) then
Result := True;
end;
end;
(*
FindMultipleColors
~~~~~~~~~~~
.. code-block:: pascal
function FindColorsMM(var ATPA : T2DPointArray; Colors : TIntegerArray; MinRadius,MaxRadius,Tolerance : Integer) : Boolean;
Returns the colors found within the minimap circle
.. note::
Author: m34tcode
Last Modified: 5/17/12 by m34tcode
Example:
.. code-block:: pascal
FindColorsMM(ATPA,[16777215,4539717],45,70,10);
Smart_DrawDots(MergeATPA(ATPA));
*)
function FindColorsMM(var ATPA : T2DPointArray; Colors : TIntegerArray; MinRadius,MaxRadius,Tolerance : Integer) : Boolean;
var
I : Integer;
begin
FindMultipleColors(ATPA,Colors,IntToBox(MMX1,MMY1,MMX2,MMY2),Tolerance);
for I := 0 to High(ATPA) do
begin
FilterPointsDist(ATPA[I],MinRadius,MaxRadius,MMCX,MMCY);
if not Result and (Length(ATPA[I]) > 0) then
Result := True;
end;
end; Find Multiple colors is the same as findColors, except it will return the results of multiple calls in an ATPA.
FindColorsMM Will Return all colors found in just the minimap circle.
Usefull enough to be merged into the SRL include? I can commit and send a pull request if so