All pastes #146801 Raw Edit

Something

public lua v1 · immutable
#146801 ·published 2006-08-23 21:46 UTC
rendered paste body
local function UnitIterator()	local pmem, rmem = GetNumPartyMembers(), GetNumRaidMembers()	local playersent = false	local petsent = false	local unitcount = 1	local petcount = 1	local unit, name	return function()		-- blah blah		if rmem > 0 then			-- STEP 3a: pet units			for i = petcount, rmem do				unit = string.format("raidpet%d", i)				petcount = petcount + 1				name = GetName(unit)				if name and not UnitIsCharmed(unit) then					return unit, name				end			end			-- STEP 3b: player units			for i = unitcount, rmem do				unit = string.format("raid%d", i)				unitcount = unitcount + 1				name = GetName(unit)				if name then					return unit, name				end			end		-- blah blah		end	endend