Showing posts with label macro. Show all posts
Showing posts with label macro. Show all posts

Thursday, March 19, 2009

[General]Toggling Maul part 2 - making a better toggle

Some really nice discussion about the maul macro talked about yesterday. Instead of answering in that post some of the questions that came up, I figured it'd be easier to talk more about it in another post.

First off, you can remove the "if not InCombatLockdown() then...end" part of the macro. That gets you a ton of extra characters, which allows you to do something like this instead:

/run local i=GetMacroIndexByName ("Ma") local mt=GetMacroBody(i) local a=strlen(mt) local v="/cast Mangle" if a < 15 then mt=v.."\n/cast [nomodifier]!Maul" else mt=v end local n,t,_,l=GetMacroInfo(i) EditMacro(i,n,t,mt,l,1)


This will change the mangle to do a mangle in one case, or do a mangle/maul in the other case as long as you don't hold down a modifier key (alt, shift, ctrl). Which might be nice for finer grained control.

Next, thanks to reader Pockie I figured out how to make this a one-button toggle. Though it's a bit involved. Here are the steps (and this should answer your question, secretagentcat)

First, make three macros for your basic attacks: Mangle (Ma), Lacerate (La) and swipe (Sw).
Next, make modifier toggle macros for those three attacks like the ones above. Put them on a bar that is hidden normally.
Next, use another macro to determine what the name of that button is in the WoW UI world. The macro for this is:

/run local f = GetMouseFocus(); if f then DEFAULT_CHAT_FRAME:AddMessage(f:GetName()) end
Bind this to a button with a keypress for now.
Then, hover over one of the three toggle macros and use the macro above. You should see something like "BTBar4Button28" in your chat window. Do that for all three toggle macros.
Finally, write a macro called 'toggle' that looks like this:

/click BTBar4Button28
/click BTBar4Button29
/click BTBar4Button30
Where the BTBar4Button28-30 are the text strings that appeared in your chat window. And bind that to a key. Now you can hide the bar with the three separate toggles and toggle everything with one key while having only 4 visible buttons. Of course, this doesn't work all that well if you have a shortage of bars or don't have hideable bars.

An alternative (as Pockie suggests) is to do something like this:

An alternative would be to have your 3 ability macros have a line "/click MaulButton" instead of "/cast !Maul". MaulButton will be a macro that simply consists of "/cast !Maul", and it's hidden somewhere on your bars. You then have a toggle macro on your main bars that will modify the MaulButton macro to "//cast !Maul". The end result is that you only use up 2 buttons (1 visible 1 hidden).
I like that idea too, though it's not for me personally; I like being able to do it for each type of attack potentially. The big advantage of this is that it allows for a lot of text in that /cast !maul macro, at least in theory. You could easily toggle between it doing /cast [modifier:shift] !maul and /cast [nomodifier] !maul, which might be nice.

If this is daunting to you, don't worry about it too much. There should be an addon soon that fixes this a bit and allows for a lot more complex and maintainable using of this type of feature, and it'll come out soon. At least hopefully.

Nav does what a lot of people out there - he has a castsequence macro and spams it and his maul button. Astrylian (of Rawr fame) had a one-button tanking macro that was good for 95% of all encounters. It was basically mangle, lacerate, swipe with the ability to override in certain circumstances (like on berserk) and did auto-mauling except on overrides. I tried that for a while, but it felt really uncontrolled and awkward. But it was at least one button. I would strongly recommend macroing maul into the basic attacks if you can, though; the difference between spamming one and two buttons is night and day, especially when doing things like moving while doing so.

Felkan asked about the ! in front of maul. I think that they've actually turned off the ability to 'toggle' maul, but it was put in there as a precaution. I've honestly not tested it much to see whether or not the toggle works. My experience is that it doesn't matter, but only actual testing would know for certain. I do know that pressing maul multiple times will turn off the highlighting on the button - but that doesn't seem to affect the actual next cast of maul.

Saroosh asked about extra macro slots in 3.1. And sadly the answer is no - you have only the normal set of macros. Ugh. Again, an addon would help this tremendously.

SecretAgentCat also asked about if you could modify a macro so that it would target different things at various parts of the fight and allow you to spam it. And the answer is no - at least not like this does. You can't modify the text of a macro during combat. Additionally, you can't do a castsequence either for targets; only actual casts works for this. Still, you probably can get away with doing something like this for your specific needs:

/tar Shad
/tar Vesp
/cast Growl
/cast Faerie Fire (feral)
/tar Shad
/tar Teneb
If Tenebron and Shadron are up, it will first target Shad, then fail to target Vesperon (since he's not around), then growl, faerie fire, target Shadron again, then target Tenebron, ending up on Tenebron. If Shadron and Vesperon are up, it'll target Shadron, then target Vesperon, growl and faerie fire Vesperon, target Shadron again and then fail to target Tenebron (since he's not around), ending up on Shadron. I think that's what you want it to do. Alternately, you can do tricky things with setting your focus and then reseting it, but I don't think it's really necessary for something specific like this.

Wednesday, March 18, 2009

[General]Toggling Maul/HS


One of the bigger headaches I've had is having to queue up maul while doing attacks. Maul is a huge part of the bear threat component - over 60% - so it's required when doing most tanking duties assuming you have enough rage. But it's not really useful to just press it separately from the other attacks. Most of the time I maul/swipe, maul/lacerate, and maul/mangle.

Except, of course, when I don't. When I absolutely need to not do this for whatever reason, such as me not wanting to do a lot of threat. In that case, most of the time I don't want to use maul at all, or I'll want to use it selectively.

I could add the following to make sure that I cast maul whenever I cast an attack:
/cast !maul
The exclamation is there to make sure you don't toggle it off if it's already on, so you can spam it. But then, I don't get the choice of doing maul or not. It'll always maul.

Okay, I can add modifiers:
/cast [modifier:shift] !maul
or
/cast [nomodifier] !maul
But then I have to hold down a shift key while spamming the button anyway, which still involves two buttons. Bleh. Or hold down a button when I don't want to use it. Again, bleh.

What I'd like is to turn maul off for a duration of a fight, if I want. So that for some fight I could just maul to my heart's content, but for another I could choose to do it if I wanted. The problem here is that there's no capslock type of system. I can't just press a button and have it 'held' without programmable keyboards. What to do?

Well, if you're sarf from EJ, you hack the bastard instead and you write a macro that rewrites another macro. Which is a brilliant idea. I had to modify his initial crack at it and mine's not nearly as elegant, but it does work.
/run if not InCombatLockdown() then local i=GetMacroIndexByName ("Ma") local mt=GetMacroBody(i) local a=strlen(mt) local v="/cast Mangle" if a < 15 then mt=v.."\n/cast !Maul" else mt=v end local n,t,_,l=GetMacroInfo(i) EditMacro(i,n,t,mt,l,1) end

With the other macro called 'Ma' being this:
/cast mangle

What this does is the following:
  • checks to see whether you're in combat. (you can't modify macros in combat).
  • Gets the macro that's called 'Ma'. This looks for a macro called Ma and grabs info about it. It's important that you have this macro already.
  • gets the length of that macro
  • if the length is smaller than the extended version, make the macro's text be:
    /cast Mangle
    /cast !Maul
  • Otherwise, make it be:
    /cast Mangle
  • Then edit the macro 'Ma' to say whatever you said above.
That means that if you press this macro, it'll change your 'Ma' macro to either be with or without maul. And it'll stay that way for as long as you don't change it back.

Then, I had three sets of macros (Ma, La and Sw) and set up an associated modifier macro to change them for mangle, lacerate and swipe. So I can toggle all three of these abilities as I need to. Just change the parts above in bold from Ma and Mangle to La and Lacerate or Sw and Swipe. It's a total of 6 macros, which is not great. But it does work for exactly what I want it.

In practice I don't find myself toggling them all that much. For more threat-sensitive fights, I'll likely take lacerate off the automaul but not swipe and mangle. If it's imperative that I don't maul at all or I only maul when it's safe because of CC, I can take them all off and do it manually as before.

Sarf has said that if there's interest, he'd clean it up and make an addon that could toggle these things more easily and get around the 255 character limit, which would be ideal. But even so, this removes about half of the keystrokes I use normally, and makes me a happy druid. I don't know whether this will work precisely as well for warriors given that their swing speed is close to their GCD speed, but it might help some.

Thursday, May 15, 2008

[Druid] Intellgent powershifting macro

This was posted at EJ, and it's so incredible I had to share it.
Many thanks to Malthoreniel on Terrordar (EU) for this.

#showtooltip
/run if pwx then local f="Cat Form";f=GetSpellCooldown(f)>0 or UnitMana('player')>pws or not IsUsableSpell(f) or CancelPlayerBuff(f) end
/cast [form] Mangle
/stopmacro [form]
/cast Cat Form



and

/run local c=DEFAULT_CHAT_FRAME if pwx then pwx=false c:AddMessage("Powershift disabled",1,1,1) else pwx=true pws=8 c:AddMessage("Powershift enabled, 8 energy threshold",1,1,1)end



The first macro is put in for mangle, shred and rip - you'd need one for each attack, and it'd replace your buttons. (replace mangle with shred/rip in the above macro) The second macro enables/disables the other ones globally, which turns on/off the behavior depending on what you're doing (soloing/raiding, for instance).

What the macro actually does is that it will use the attack if you have the energy to do it. If you don't, it'll check whether you're on GCD, and if you're above an energy threshold (pws); if you are, it does nothing. If not, it'll automatically powershift you. The above ones are set to powershift at 8 energy or less, but you can change this around globally (in the second macro) or change it per attack like this:

#showtooltip
/run if pwx then local f="Cat Form";f=GetSpellCooldown(f)>0 or UnitMana('player')>15 or not IsUsableSpell(f) or CancelPlayerBuff(f) end
/cast [form] Mangle
/stopmacro [form]
/cast Cat Form



In that example you will powershift at 15 energy or less if you use mangle.

Why I love it - because it takes all the pain out of powershifting and makes it automatic if you want to. The only drawback is that it may be hard to put in a use of a haste pot or trinket in there; I've not checked out the total # of characters it takes. But otherwise, spam, spam, spam away.