File: Util.em

Description: Utility functions
Last Modified: 10/27/2007

RandomDiceRoll(String dice_string)
Parameters:
Name | Type
dice_string | String
Explanation
Returns a random number according to the passed die roll string. This is standard NdS+X format. N=number of dies to roll, S=number of sides per die, X=integer to add(or subtract) after roll.
Here's some acceptable examples:
    4
    d4
    d6+6
    d6-2
    2d12
    2d8+12
    2d8-4
Return values
Valkyrie's pedantic wording: "returns an integer greater or equal to N+X and not more than N*S+X"

RandomFloat(real below_this_number)
Parameters:
Name | Type
below_this_number | Real
Explanation
Returns a random real below the passed parameter and greater or equal to zero.
Return values
Real R such that 0 less or equal to R less than below_this_number
Errors
"RandomFloat() expects a Real parameter"

RandomInt(integer below_this_number)
Parameters:
Name | Type
below_this_number | Integer
Explanation
Returns a random integer below the passed parameter and greater or equal to zero.
Return values
Integer R such that 0 less or equal to R less than below_this_number
Errors
"RandomInt() expects a positive integer"

StrFormatTime( format_string, time_stamp:=0 )
Parameters:
Name | Type
format_string | String
time_stamp | Integer
Explanation
Takes in the StrFTime() specifiers for the format string.
If time_stamp is 0, it will use POLCore().systime.
For format_string information, please go to http://www.cppreference.com/stddate/strftime.html
Return values
String
Errors
"RandomFloat() expects a Real parameter"
"Format string exceeded 100 characters."

If you know if any information is incorrect on these pages, mail your corrections to polteam@polserver.com

Copyright ©2003-2006 David Carpman and POL Development Team, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.