Thread Tools Display Modes
12-13-09, 07:51 PM   #1
Manaman
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 39
Tank Role Assist Macro/Binding

I have no idea where to start myself really in creating a mod that does this:

I want a binding(surprised blizzard didn't implement themselves) to assist the person assigned as tank by the LFD tool.

I figure I use some code similar to what's used in the Give Me mod to dynamically set a macro to assist the name of what's returned by GetLFGRoles()?
  Reply With Quote
12-13-09, 08:06 PM   #2
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
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)

Last edited by Akryn : 12-13-09 at 09:15 PM.
  Reply With Quote
12-13-09, 11:03 PM   #3
Manaman
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 39
Thank you for the prompt response and the code. I didn't expect to even get any response, let alone exactly what I was looking for.
  Reply With Quote
12-13-09, 11:30 PM   #4
zero-kill
A Firelord
 
zero-kill's Avatar
Join Date: Aug 2009
Posts: 497
Thanks, this will help!
  Reply With Quote
12-14-09, 03:29 AM   #5
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
Ill have to point my guildies to this. Love em to death but they seem to have issues/laziness for making a macro for assisting the tank or targeting them and using the assist key. You should consider making this a published addon with perhaps a way to set the keybind in game.
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote
12-14-09, 07:12 AM   #6
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Well I can't log in to test it ATM. Has anyone tried it yet?
  Reply With Quote
12-14-09, 07:44 AM   #7
Manaman
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 39
I tried today to test it, but I just can't seem to find a group that needs DPS. I will be in the Q forever as DPS, but if I Q as tank it's instantaneous. Makes it hard to test this code. Will get back to you when I have had a chance to test.
  Reply With Quote
12-14-09, 08:20 PM   #8
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
http://www.wowinterface.com/download...ankAssist.html

I still haven't had time to test this properly, but I don't see why it wouldn't work unless I made a mistake/typo somewhere. It loads anyway...
  Reply With Quote
01-27-10, 10:53 PM   #9
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Just wanted to mention that I released a 1.0 version of this.

And thanks for the idea; I've ended up using it a lot, which I didn't think I would.
  Reply With Quote
01-27-10, 11:42 PM   #10
Manaman
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 39
Thank you again for making it. It has worked out well.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Tank Role Assist Macro/Binding

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off