Untested:
Code:
/run local p for u=1,4 do p="party"..u if UnitGroupRolesAssigned(p) then break end if u==4 then return end end SetBindingMacro("PUT_YOUR_KEYBIND_HERE", "/assist "..UnitName(p))
You can make that a macro and hit it at the beginning of a group, or turn it into an addon that runs when a group is filled. You can't just make a keybind without running something like this first because there is no "unit" that corresponds to the party tank, so it would fail in combat.
Edit: Here it is as a simple addon, assuming shift-f as the keybind arbitrarily...
Code:
local me = CreateFrame("frame")
me:RegisterEvent("PARTY_MEMBERS_CHANGED")
me:SetScript("OnEvent", function(self)
if GetNumPartyMembers() ~= 5 then return end
local u, p
for u = 1, 4 do
p = "party" .. u
if UnitGroupRolesAssigned(p) then
if InCombatLockdown() then
self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
SetBindingMacro("SHIFT-F", "/assist " .. UnitName(p))
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
return
end
end
end)