Guest
May 20, 2012, 4:05 pm UTCHome arrow Commands arrow Wolfscript arrow Math Functions
header image
Math Functions
Written by Dream Dancer   
Apr 16, 2008 at 07:54 AM

Another unique to Wolfscript is that it provides more powerful math functions over what can be found with the Variable Functions found in Botscript.

ADD DestVar AddWhat
0 Variable To Affect
1 Value To Add
Add's AddWhat to DestVar and stores the result in DestVar.
EQ: DestVar = DestVar + AddWhat
DIV DestVar DivWhat
0 Variable To Affect
1 Value To Divide By
Divides DestVar with DivWhat and stores the result in DestVar. Division by Zero attempts return Zero.
FIX(Number)
0 Number
Applies the FIX function to the value provided, stripping any decimals from the number. With negative numbers, FIX will return the lowest (closest to Zero) number.
FURCTOINT(Furcadian Number String)
0 Encoded Furcadia Base 95 Number
1 Base220
Takes the passed string and attempts to return a number based on how the server sends numbers to the client. If you set the optional second parameter to TRUE, that is, type in the word TRUE there, it will preform the conversion from Base220 instead of Base 95. It converts a maximum of 2 characters into a number.
INT(Number)
0 Number
Applies the INT function to the value provided, stripping any decimals from the number. With negative numbers, will convert -8.4 to -9.
MUL DestVar MulWhat
0 Variable To Affect
1 Value To Multiply With
Multiplies DestVar with MulWhat and stores the result in DestVar .
RAND(Number)
0 Type Of Rnd Number
Err, ha:
Returns a Single containing a random number.
Syntax
Rnd [ ( number ) ]
The optional number argument is a Single or any valid numeric expression.
Return Values
Remarks:
The Rnd function returns a value less than 1 but greater than or equal to zero. Tongue
RANDOM(Lower Upper)
0 Lower Limit
1 Upper Limit
Returns a random integer from Lower to Upper inclusive. Implemented because sometimes you don't want to do fancy math to get a random number within a range.
SQR(Number)
0 Number
Returns the square root of a number.
SUB DestVar SubWhat
0 Variable To Affect
1 Value To Subtract
Subtracts SubWhat from DestVar and stores the result in DestVar .
Last Updated ( Jun 21, 2008 at 10:40 PM )
<Previous   Next>
header image