Using SetAttribute to bind tradeskill to button
Is it possible to bind a tradeskill to a button using SetAttribute?
I've tried everything I know (which isn't much) to bind a tradeskill to a button in an addon. I can get any spell to work, but tradeskills are not working for some reason. Code:
cdbutton:SetAttribute("type", "spell") So far what I've come up with is that tradeskills are not considered spells anymore, so I'm curious what I need to do to make the button work. Any ideas? |
Make it a macro rather than a spell, with a text of "/cast Northrend Alchemy Research".
|
That unfortunately does not work. With or without the alchemy window open.
I did however find a way to do it, but it requires knowing the index of the tradeskill you are trying to cast by using DoTradeSkill(). The issue is then all the sections have to be open to set an accurate index and I'm not sure it works with your second trade skill. |
just to make sure, the macro :setattribute is tricky.
its :SetAttribute("type","macro") :SetAttribute("macrotext", "/cast ...") took me forever to figure that one out >< |
It's possible to cast tradeskill recipe spells from an action bar without the window open, and you could rig a button up for this, but unless you're willing to take over an action slot permanently, this trick won't work in combat. Here's a non-combat-only version that swaps actions around just long enough to cast your tradeskill:
Code:
cdbutton:SetAttribute("type", "action") |
All times are GMT -6. The time now is 12:43 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI