Utility Functions
Aurora Framework provides several utility functions to help with rotation development. These functions make common tasks easier and standardize functionality across different game versions.
Texture Handling
Aurora.texture(idOrPath, size)
Creates a texture string for use in UI text.
-- Parameters:
-- idOrPath: number or string - Spell ID or texture path
-- size: number - Size of the texture (default: 14)
-- Returns: string - Texture string formatted for UI display
-- Example with spell ID:
local spellTexture = Aurora.texture(100)
print("Spell icon: " .. spellTexture .. " Charge")
-- Example with custom size:
local largeTexture = Aurora.texture(100, 24)
print("Large icon: " .. largeTexture .. " Charge")
-- Example with direct texture path:
local customTexture = Aurora.texture("Interface\\Icons\\INV_Misc_QuestionMark", 16)
print("Custom icon: " .. customTexture)
Map & Location
Aurora.mapid
Gets the current instance/map ID.
-- Returns: number - Current instance ID, or 0 if not in an instance
## Group Analysis
### Aurora.groupttd()
Calculates the average time-to-die (TTD) for all enemies within 40 yards.
```lua
-- Returns: number - Average TTD in seconds, or 999 for training dummies
-- Example:
local avgTTD = Aurora.groupttd()
if avgTTD > 10 then
-- Use longer cooldowns
else
-- Use burst abilities
end
Aurora.grouphp(distance)
Calculates the average health percentage of the group within the specified range.
-- Parameters:
-- distance: number - Maximum distance to check (default: 40)
-- Returns: number - Average health percentage of the group
-- Example:
local avgHealth = Aurora.grouphp()
if avgHealth < 70 then
-- Use AoE healing
end
-- With custom distance:
local closeRangeHealth = Aurora.grouphp(10)
Aurora.grouphpcount(distance, percent)
Counts group members above a certain health percentage within the specified range.
-- Parameters:
-- distance: number - Maximum distance to check
-- percent: number - Health percentage threshold
-- Returns: number - Count of group members above the threshold
-- Example:
local healthyCount = Aurora.grouphpcount(40, 80)
if healthyCount < 3 then
-- Use emergency healing
end
Combat Utilities
Aurora.gcd()
Gets the current Global Cooldown duration in seconds, accounting for haste.
-- Returns: number - GCD duration in seconds
-- Example:
local gcdTime = Aurora.gcd()
if ability.cooldown < gcdTime then
-- This ability will be ready by the time GCD finishes
end
Aurora.random(min, max)
Generates a random number but caches the result for 8 seconds to prevent erratic behavior during rotation execution.
-- Parameters:
-- min: number - Minimum value
-- max: number - Maximum value
-- Returns: number - Random number between min and max
-- Example:
if Aurora.random(1, 100) > 70 then
-- Do something with a 30% chance
end
Aurora.bin(value)
Converts a boolean value to a binary number (0 or 1) for use in calculations.
-- Parameters:
-- value: any - Value to convert
-- Returns: number - 0 for nil or false, 1 for anything else
-- Example:
local score = Aurora.bin(unit.aura(100)) + Aurora.bin(unit.combat)
if score == 2 then
-- Both conditions are true
end
Control Functions
Aurora.blockmovement(timewindow)
Temporarily blocks player movement for a specified time window.
-- Parameters:
-- timewindow: number - Duration in seconds to block movement
-- Example:
-- Block movement for 0.5 seconds while casting an important spell
Aurora.blockmovement(0.5)
Aurora.hascontrol
Checks whether the player has control over their character or not.
-- Returns: boolean - true if player has control, false if affected by crowd control
-- Example:
if Aurora.hascontrol then
print("I'm not affected by CC")
-- Player can move and cast spells
else
-- Player is stunned, feared, charmed, etc.
print("Player is under crowd control effects")
end