Module br.player.totem
Totem handling functions for BadRotations.
Totem functions are stored in br.player.totem and can be utilized by `local totem = br.player.totem` in your profile.
This module provides a hierarchical API for totem checks: - totem.active(candidate) -> checks if any totem matching candidate is active - totem.fire.active() -> checks if any fire totem is active in slot 1 - totem.fire.searingTotem.active() -> checks if searing totem specifically is active
Slot indices: 1 = Fire, 2 = Earth, 3 = Water, 4 = Air.
Functions
| totem.element.totemName.active () | Check if this specific totem is active. |
| totem.element.totemName.exists () | Alias for active. |
| totem.element.totemName.remain () | Get remaining time for this specific totem. |
| totem.element.totemName.duration () | Get duration for this specific totem. |
| totem.element.totemName.distance () | Get distance to this specific totem. |
| totem.element.totemName.name () | Get the name of this totem if active. |
| totem.element.active () | Check if any totem in this element slot is active. |
| totem.element.exists () | Alias for active. |
| totem.element.name () | Get the name of the active totem in this slot. |
| totem.element.remain () | Get remaining time for the active totem in this slot. |
| totem.element.duration () | Get duration for the active totem in this slot. |
| totem.element.distance () | Get distance to the active totem in this slot. |
| totem.element.is (candidates) | Check if the active totem matches any of the provided candidates. |
| totem.get (slot) | Returns raw slot info as reported by GetTotemInfo. |
| totem.remain (slot) | Returns remaining time for a slot (seconds), or 0. |
| totem.distance (slotOrCandidate) | Returns distance from player to the active totem in a slot. |
| totem.is (slot, candidates) | Returns true if the specified slot currently matches any provided totem. |
| totem.active (candidate) | Returns true if the specified totem is currently active in any slot. |
| totem.exists (candidate) | Alias for active. |
Functions
- totem.element.totemName.active ()
-
Check if this specific totem is active.
Returns:
-
boolean
- totem.element.totemName.exists ()
-
Alias for active.
Returns:
-
boolean
- totem.element.totemName.remain ()
-
Get remaining time for this specific totem.
Returns:
-
number
- totem.element.totemName.duration ()
-
Get duration for this specific totem.
Returns:
-
number
- totem.element.totemName.distance ()
-
Get distance to this specific totem.
Returns:
-
number
- totem.element.totemName.name ()
-
Get the name of this totem if active.
Returns:
-
string or nil
- totem.element.active ()
-
Check if any totem in this element slot is active.
Returns:
-
boolean
- totem.element.exists ()
-
Alias for active.
Returns:
-
boolean
- totem.element.name ()
-
Get the name of the active totem in this slot.
Returns:
-
string or nil
- totem.element.remain ()
-
Get remaining time for the active totem in this slot.
Returns:
-
number
- totem.element.duration ()
-
Get duration for the active totem in this slot.
Returns:
-
number
- totem.element.distance ()
-
Get distance to the active totem in this slot.
Returns:
-
number
- totem.element.is (candidates)
-
Check if the active totem matches any of the provided candidates.
Parameters:
- candidates ...
Returns:
-
boolean
- totem.get (slot)
-
Returns raw slot info as reported by GetTotemInfo.
Parameters:
- slot number Totem slot (1-4)
Returns:
- boolean haveTotem
- string or nil name
- number startTime
- number duration
- number or nil icon
- totem.remain (slot)
-
Returns remaining time for a slot (seconds), or 0.
Parameters:
- slot number Totem slot (1-4)
Returns:
-
number
- totem.distance (slotOrCandidate)
-
Returns distance from player to the active totem in a slot.
Returns 999 if no totem is active or the object can't be located.
Parameters:
- slotOrCandidate number or string Totem slot (1-4) or totem spell key/id/name
Returns:
-
number
- totem.is (slot, candidates)
-
Returns true if the specified slot currently matches any provided totem.
Candidates can be spell IDs (number), spell keys from br.player.spells (string), or literal localized names (string).
Parameters:
- slot number Totem slot (1-4)
- candidates ...
Returns:
-
boolean
- totem.active (candidate)
-
Returns true if the specified totem is currently active in any slot.
Candidate can be a spell key, spell ID, or localized name.
Parameters:
- candidate string or number
Returns:
-
boolean
- totem.exists (candidate)
-
Alias for active.
Parameters:
- candidate string or number
Returns:
-
boolean