Table Of Contents

Previous topic

Mapwalk

Next topic

Mouse

This Page

Math

Supporting math functions.

LoadCoSineArrays

procedure LoadCoSineArrays;

Load default sin/cos values.

Note

by Mutant Squirrle

Example:

CreateTPAFromText

function CreateTPAFromText(Txt : string; Chars : string) : TPointArray;

Returns the TPointArray of the inputted Text. Needs Wizzyplugin

Note

by MastaRaymond

Example:

GetSplitPt

function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;

Returns the point on a spline, defined by control points Points, at Theta

Note

by BenLand100

Example:

MakeSplinePath

function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;

Returns a spline, defined by control points Points, incrementing theta by ThetaInc

Note

by BenLand100

Example:

MidPoints

function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;

Adds midpoints to Path so no distance on it is greater than MaxDist

Note

by BenLand100

Example:

InAbstractBox

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:

Sine

function Sine(degrees: Integer): Extended;

Return the sin of degrees.

Note

by Mutant Squirrle

Example:

Cose

function Cose(degrees: Integer): Extended;

Return the cos of degrees.

Note

by Mutant Squirrle

Example:

MMToMS

function MMToMS(MM: TPoint): TPoint;

Turns a Minimap point into a close MS point.

Note

by N1ke!

Example:

DeleteValueInStrArray

procedure DeleteValueInStrArray(var Arr: TStringArray; ValuePosition: Integer);

Deletes value with ValuePosition in “Arr” string array.

Note

by EvilChicken!

Example:

DeleteValueInIntArray

procedure DeleteValueInIntArray(var Arr: TIntegerArray; ValuePosition: Integer);

Deletes value with ValuePosition in “Arr” Integer array.

Note

by EvilChicken!

Example:

DeleteValueInFloatArray

procedure DeleteValueInFloatArray(var Arr: TExtendedArray; ValuePosition: Integer);

Deletes value with ValuePosition in “Arr” Float array.

Note

by EvilChicken!

Example:

DeleteValueInBoolArray

procedure DeleteValueInBoolArray(var Arr: TBooleanArray; ValuePosition: Integer);

Deletes value with ValuePosition in “Arr” Boolean array.

Note

by EvilChicken!

Example:

BoxClosestPoint

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:

RandomPointBoxEx

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:

MiddleBox

function MiddleBox(b : TBox) : TPoint;

Returns the middle of the box.

Note

by Raym0nd

Example:

MSI_GroupDigits

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: