Math ==== Supporting math functions. LoadCoSineArrays ~~~~~~~~~~~~~~~~ .. code-block:: pascal procedure LoadCoSineArrays; Load default sin/cos values. .. note:: by Mutant Squirrle Example: .. code-block:: pascal CreateTPAFromText ~~~~~~~~~~~~~~~~~ .. code-block:: pascal function CreateTPAFromText(Txt : string; Chars : string) : TPointArray; Returns the TPointArray of the inputted Text. Needs Wizzyplugin .. note:: by MastaRaymond Example: .. code-block:: pascal GetSplitPt ~~~~~~~~~~ .. code-block:: pascal function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint; Returns the point on a spline, defined by control points Points, at Theta .. note:: by BenLand100 Example: .. code-block:: pascal MakeSplinePath ~~~~~~~~~~~~~~ .. code-block:: pascal function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray; Returns a spline, defined by control points Points, incrementing theta by ThetaInc .. note:: by BenLand100 Example: .. code-block:: pascal MidPoints ~~~~~~~~~ .. code-block:: pascal function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray; Adds midpoints to Path so no distance on it is greater than MaxDist .. note:: by BenLand100 Example: .. code-block:: pascal InAbstractBox ~~~~~~~~~~~~~ .. code-block:: pascal function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer): Boolean; Returns true if point x, y is in an abstract box defined by *x1, y1, x2, y2, x3, y3, x4, y4*. | x1, y1 x2, y2 | +--------+ | \ / | \ / | +--+ | x4, y4 x3, y3 .. note:: by BenLand100 Example: .. code-block:: pascal Sine ~~~~ .. code-block:: pascal function Sine(degrees: Integer): Extended; Return the sin of *degrees*. .. note:: by Mutant Squirrle Example: .. code-block:: pascal Cose ~~~~ .. code-block:: pascal function Cose(degrees: Integer): Extended; Return the cos of *degrees*. .. note:: by Mutant Squirrle Example: .. code-block:: pascal MMToMS ~~~~~~ .. code-block:: pascal function MMToMS(MM: TPoint): TPoint; Turns a Minimap point into a close MS point. .. note:: by N1ke! Example: .. code-block:: pascal DeleteValueInStrArray ~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal procedure DeleteValueInStrArray(var Arr: TStringArray; ValuePosition: Integer); Deletes value with ValuePosition in "Arr" string array. .. note:: by EvilChicken! Example: .. code-block:: pascal DeleteValueInIntArray ~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal procedure DeleteValueInIntArray(var Arr: TIntegerArray; ValuePosition: Integer); Deletes value with ValuePosition in "Arr" Integer array. .. note:: by EvilChicken! Example: .. code-block:: pascal DeleteValueInFloatArray ~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal procedure DeleteValueInFloatArray(var Arr: TExtendedArray; ValuePosition: Integer); Deletes value with ValuePosition in "Arr" Float array. .. note:: by EvilChicken! Example: .. code-block:: pascal DeleteValueInBoolArray ~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal procedure DeleteValueInBoolArray(var Arr: TBooleanArray; ValuePosition: Integer); Deletes value with ValuePosition in "Arr" Boolean array. .. note:: by EvilChicken! Example: .. code-block:: pascal BoxClosestPoint ~~~~~~~~~~~~~~~ .. code-block:: pascal function BoxClosestPoint(p : TPoint; b : TBox) : TPoint; There are 'nine' places where the point can be (relative to a box).. The middle, 5, is the box itself. The rest looks like this: | 1 | 2 | 3 | --------- | 4 | 5 | 6 | --------- | 7 | 8 | 9 Place 9 means it's past the b.x2, and past the b.y2, therefore the smallest dist between the point and the box is the distance between the point and the box's x2,y2 coordinate. .. note:: by Raym0nd Example: .. code-block:: pascal RandomPointBoxEx ~~~~~~~~~~~~~~~~ .. code-block:: pascal function RandomPointBoxEx(p : TPoint; b : TBox; extraDist : integer) : TPoint; Returns a point in the box which is 'aimed' near the TPoint given.. Basically it only allows points that lay within the extradist from the closest point to be returned. Practical example: Inventory Box.. When your mouse is on the right of an inv item, you don't want to click on the left of the box. .. note:: by Raym0nd Example: .. code-block:: pascal MiddleBox ~~~~~~~~~ .. code-block:: pascal function MiddleBox(b : TBox) : TPoint; Returns the middle of the box. .. note:: by Raym0nd Example: .. code-block:: pascal MSI_GroupDigits ~~~~~~~~~~~~~~~ .. code-block:: pascal function MSI_GroupDigits(n: integer; token: String): String; Adds midpoints to Path so no distance on it is greater than MaxDist .. note:: by PriSoner and Nava2 Example: .. code-block:: pascal