Lists
What are they?
Lists in Aurora Framework are powerful collections of Unit objects that provide various methods for filtering, iterating, and manipulating groups of units. Each list is automatically updated and managed by the ObjectManager.
Available Lists
enemies
Contains enemy units that are relevant to the current context.
local enemies = Aurora.enemies
friends
Contains friendly units, including those not in your group.
local friends = Aurora.friends
group
Contains group members (party/raid) excluding the player.
local group = Aurora.group
fgroup
Contains group members including the player (full group).
local fgroup = Aurora.fgroup
activeenemies
Contains enemy units that are in combat and have threat.
local activeenemies = Aurora.activeenemies
dead
Contains all dead units.
local dead = Aurora.dead
units
Contains all units regardless of type.
local units = Aurora.units
objects
Contains all game objects.
local objects = Aurora.objects
missiles
Contains all missiles.
local missiles = Aurora.missiles
areatriggers
Contains all areatriggers.
local areatriggers = Aurora.areatriggers
List Methods
each(callback)
Iterate through the list with a callback that receives the unit, index, and uptime. Returning true from the callback breaks the loop.
enemies:each(function(unit, i, uptime)
print("Enemy #" .. i .. " has been visible for " .. uptime .. " seconds")
if unit.hp < 20 then
return true -- breaks the loop
end
end)
filter(callback)
Create a new list containing units that match the callback criteria.
local lowHealth = enemies:filter(function(unit)
return unit.hp < 50
end)
first(callback)
Get the first unit that matches the callback criteria.
local target = enemies:first(function(unit)
return unit.hp < 20
end)
random()
Get a random unit from the list.
local randomEnemy = enemies:random()
print(randomEnemy.name)
sort(callback)
Sort the list based on the callback criteria.
enemies:sort(function(a, b)
return a.hp < b.hp
end)
within(distance)
Get units within a specified distance from the player.
-- Get enemies within 10 yards of the player
local nearbyEnemies = Aurora.activeenemies:within(10)
-- Get all units within melee range (5 yards default)
local meleeRange = Aurora.activeenemies:within()
around(centerUnit, distance, criteria)
Count and get units around a center unit or position with optional filtering criteria.
-- Count enemies around a specific unit within 8 yards
local count, _, nearbyUnits = Aurora.activeenemies:around(tank, 8)
-- Count enemies around player with filtering
local dangerousCount, totalCount, dangerousEnemies = Aurora.activeenemies:around(player, 15, function(unit)
return unit.hp > 80 and unit.casting
end)
-- Count units around a specific position
local position = {x = 100, y = 0, z = 200}
local count, _, unitsAtPosition = Aurora.units:around(position, 5)
Usage Examples
Basic Iteration
-- Loop through enemies
enemies:each(function(enemy, index, uptime)
print("Processing enemy #" .. index .. " visible for " .. uptime .. " seconds")
if enemy.hp < 20 and enemy.distance < 30 then
-- Do something with low health nearby enemy
return true -- break the loop
end
end)
Filtering and Chaining
-- Get low health enemies and loop through them
enemies:filter(function(unit)
return unit.hp < 50
end):each(function(unit)
-- Heal or damage low health units
end)
Complex Conditions
-- Find specific types of units
local targets = enemies:filter(function(unit)
return unit.ishumanoid
and not unit.dead
and unit.distanceto(player) < 40
and unit.los
end)
targets:each(function(unit)
-- Process filtered units
end)
Group Management
-- Heal group members
group:each(function(member)
if member.hp < 80 and member.distanceto(player) < 40 then
-- Heal the group member
return true
end
end)
Distance-Based Filtering
-- Get enemies within melee range and attack the lowest health one
local meleeEnemies = Aurora.activeenemies:within(5)
local target = meleeEnemies:first(function(unit)
return unit.hp < 30
end)
-- Count dangerous enemies around the tank
local dangerousCount, totalCount, dangerousEnemies = Aurora.activeenemies:around(tank, 10, function(unit)
return unit.casting or unit.channeling
end)
if dangerousCount > 2 then
print("Chuckles, im in Danger")
end
Best Practices
- Use
eachinstead of Lua'sforloops for better control flow - Chain methods when possible to reduce iterations
- Use
filterwhen you need to reuse a filtered list multiple times - Break loops early when you find what you need
- Always check unit existence before accessing properties
- Consider range and line of sight for actions
Notes
- Lists only contain valid units/objects
each: Returns nil. When the callback returns true, the loop breaks earlyfilter: Returns a new list with filtered unitsfirst: Returns the first matching unit or nonerandom: Returns a random unit from the listwithin: Returns a new list with units within the specified distance from playeraround: Returns count (matching criteria), secondaryCount (total in range), and list of units