Module util
Small helpers a profile needs that aren't about units, spells or the screen: the game clock, named timers and rounding.
Util functions are the profile API table `util` (br.api.profile.util); profiles use it by name.
Functions
| round (num[, numDecimalPlaces=2]) | Rounds a number to the specified number of decimal places (default 2) |
| time () | Returns the time, value of GetTime |
| timer (timerName, interval) | True the first time, then again each time the interval has passed since it was last true |
Functions
- round (num[, numDecimalPlaces=2])
-
Rounds a number to the specified number of decimal places (default 2)
Parameters:
- num number - The number to round.
- numDecimalPlaces number - The number of decimal places to round to. (default 2)
Returns:
-
number - Returns the rounded number
- time ()
-
Returns the time, value of GetTime
Returns:
-
number - Returns the current game time
- timer (timerName, interval)
-
True the first time, then again each time the interval has passed since it was last true
Parameters:
- timerName string - The name of the timer check, should be unique.
- interval number - The length of time to wait until true, in seconds.
Returns:
-
boolean - Returns true if the interval has passed
Usage:
if util.timer("Hunter's Mark", 2) then