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.

19 comments:

seriallos said...

Holy crap this is awesome. You are now my hero.

Anonymous said...

Awesome! I knew there was a way to do this. Ages ago, I tried, and as a programmer, I was pretty confident. But it was getting too complex and I decided not being able to do this was no-biggie. Thanks for this! The whole world should here about it. Stick it on the official forums or something.

Monkeytree said...

Very funky solution.
Personally, I just have swipe, mangle, lacerate and maul on keys 2, 3, 4 and 5. Then, as I'm tanking, I just press 5+2, or 5+3, etc. I just hammer away. And it's easy to just drop out maul - just stop pressing that button.

Anonymous said...

That is fancy, I appreciate the work. This is hurting my head looking at the macro, as i'm not macro savvy but am curious if it's possible to add one more step of complexity.

When it changes the macro from /cast mangle to /cast !maul, /cast mangle is there a way for it to also change a different macro from /cast !maul to /cast mangle?

The reason being, I can use my standard maul key bound as maul when it's not triggered with mangle. And then when it is triggering with mangle, i can use that same keybound as a maul less mangle without fear of breaking CC?

Kalon said...

seriallos - glad to help. Sarf did the heavy lifting, and if he gets the addon working it'll be a thing of awesome.

Anon1 - I'd like to play with it more before sending it out to the general universe, but yeah, ideally it seems like the thing to know.

Monkeytree - this macro is exactly trying to avoid that situation. That was exactly what I did too - 4 was maul, 1,2,3 were attacks. And I hated pressing both buttons all the time. It was just obnoxious and prone to error.

Anon2 - I'm not quite sure I understand what you're asking. If you've bound maul to a key normally, you could use it to toggle the maul instead. So if (for example) your #3 was the /cast mangle /cast !maul button, and #4 was /cast maul, if you hit 3 and 4 you'd just mangle.

One of the things I'd like to do is make it so that the toggle toggles a modifier so that you cast the maul either all the time except for the shift, or all the time with the shift. But that needs more text, and this macro is already close to the limit. If it's made an addon, that should be doable though; you could modify multiple macros at the same time with the addon.

pockie said...

I have a suggestion that I think could improve this.

If I understand correctly, you want to be able to toggle maul, before a fight, such that if toggled you will use it on every mangle/lacerate/swipe. You have solved it but now have 6 buttons, with 3 being "toggle macros".

I believe you can call a macro from within another macro (not sure of the exact syntax but this is how decursive and mods such as totemtimers works). You could try simply having one macro, doing /cast Maul. Your mangle, lacerate and swipe macros will call this macro. If you want to disable maul, simply open up your macro menu, and add another / in front so it looks like //cast Maul. This will cause the maul macro to do nothing, and your other 3 buttons will just mangle/lacerate/swipe. Want to maul again? Delete the /, and you'll add a maul with every special attack.

This way you save on the 3 "toggle macros". If you really want to, modify your toggle macro to just change this single maul macro.

Of course this is predicated by being able to call a macro within another macro, which is something I'm pretty sure can be done but I can't tell you exactly how to do it. It also assumes you don't want to only maul together with swipe and not mangle, or something like that.

Jacob said...

pockie wrote: If you want to disable maul, simply open up your macro menu, and add another / in front so it looks like //cast Maul.

The idea to "simply" open up your macro window and edit your Maul macro is actually not that simple - it's requires a fair amount of clicking, searching, and precise typing.

Wouldn't it be nice if you could write a macro that would automatically do all this work of enabling or disabling Maul?

It would be nice, and that's what the macro in the original post does.

pockie said...

Yeah, if you don't want to open up your macro window then you could just modify the macro Kalon posted to modify the /cast Maul macro instead of having 3 separate toggle macros to modify 3 others. At least you save 2 buttons. There's no point in having 3 lines in 3 separate macros that do the same thing if you can call a single function in each one.

That said, after thinking about it a bit I'm not so sure anymore that it's so easy to call a macro within another macro. I'll have to go test this out...

Marino said...

As I understand it, it is not possible to change a macro while in combat. So this trick has to be done before the fight?
Would it not be simply possible to have 3 with /cast !maul in them on a different bar and drag them in there if needed.

You can do that before the fight and if needed in between the fight (if you do not lock you buttons).

Still not all is perfect.

So then I thought of a different solution. It is possible to change actionbars. That can be done mid fight too. Caused a wipe now and then (Shift - 1, shift - 2, etc accidentally pressed or shift + mousesctroll). So I unbound all those things. But now I am considering binding 2 bars to a key combination again.

It goes like this:
When you press ctrl + alt + = you switch to standard bar and a different bar that will show up when you press ctrl + alt + -. The change you hit that accidentally during a fight is really small.

Bar 1 is exactly like bar 2. Except bar 2 misses the maul button and has 3 macro's containing /cast !maul for swipe lacerate and mangle.
It is easy to see which bar is which so you are not confused. It requires only 3 simple macro's that even my girlfriend would understand AND you can switch mid fight.
No auto mangle when you are near cc-ed targets. Then when you have dragged am away ctrl + alt + - and start auto mauling.

So... what did I not understand here or is this a possibly better and easier solution? (Providing you have a free actionbar which I don't have).

Phil Jackson said...

If this was set up into an addon where all I did was click on button to turn it on or off this would be great. But this sounds like I'm not saving a whole lot of time if I was constantly opening up my macro window to change something fearing a mistype.

Kalon said...

pockie - while you can't call a macro from another macro, what you can do is simulate a button click by doing the following:

/click MultiBarRightButton1

Where MultiBarRightButton1 would be the name of the button. You can do this multiple times in the same macro, so you could have that one button press all three. Since they take no GCD, this should be instantaneous. This'll be dependent on how you set it up, but for most bar systems you could just put those three macros on any bar you wanted and hide the bar, then have the macro that presses all three. I'll find out how this works and post later.

Marino - switching actionbars is another option. I kind of liked this one in that you could mix and match as you saw fit with setting each individually, but yeah, if that's not your bag that's cool. And like you said, you could switch actionbars in combat. That's an interesting idea.

Phil - the whole purpose is to explicitly not edit the macros yourself. Right now it's one button per attack. I think I can get it to be one button for everything.

pockie said...

Ah Kalon, thanks for clearing that up. Guess its not quite as elegant as I had hoped.

However I think the principle can still be used with your current idea. E.g. if you are using the /click ButtonName idea, I sense that you are going to have 3 hidden buttons for your 3 "toggle macros", and 1 button on your bars that will /click toggle1, click toggle2, /click toggle3? So overall you will have 4 buttons (1 visible, 3 hidden).

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).

Sorry, I really have very limited space on my bars so saving 2 buttons seems like a lot to me >.<

Nav said...

Definitely an interesting read Kalon. The macro setup is pretty insane!

I've reduced my tanking to spamming two buttons, with only one straight-forward macro.

I have a Mangle/Swipe macro bound to 2, and Maul bound to 3. The macro has a reset equal to Mangle's CD so it's guaranteed that Mangle will be cast every time it's up, otherwise it's going to be a Swipe.

Maul being bound to 3 allows me to just spam 2/3 under normal circumstances and only 2 when I need to watch the rage.

Alt-2 is bound to Mangle, for when I pop Berserk. This allows me to get around the macro's reset.

Alt-3 is bound to Maul, so that I get to hold down Alt and still spam Mangle (while Berserk'd) and Maul. I basically just hold down Alt and spam 2/3 just like before.

I've bound Lacerate to 1, since it's used much less relatively.

Alt-1 autoattacks.

This works fine for me. Hope it helps somebody out there.

Felkan said...

Nice, I have a separate button (macro) that just does /cast mual, /cast swipe. That I spam on trash.

I'm wondering why I need the "!" in front of the maul? I've never notice maul being toggled off when I mash that button. Maybe it does??

Just wondering about the "!" in front of maul...

Saroosh said...

ZOMG...this is totally awesome <3 ...now I need to find more macro slots, eek....I would so give a huge bear hug for a mod =)

On a seperate note, do we have a seperate set of macro slots on duel spec, this would open up a number of macro slots as I still have all my mouse over healing macros?

secretagentcat said...

So, to use this practically, I would have Ma, La, and Sw on my cast bar, those would be the buttons I'm pressing repeatedly in order to generate threat.

The three 'toggle' macros I would ideally have placed somewhere out of the way (where I could click them) in order to turn off the maul aspect of each attack in turn?

Am I getting that right?

Additionally, I set up a pair of macros to try to get control of Shadron and Vesperon while the previous drake is still up, there's two macros, the first is:

/tar Shad
/cast Growl
/cast Faerie Fire (feral)
/tar Teneb

the second is:

/tar Vesp
/cast Growl
/cast Faerie Fire (feral)
/tar Shad

I don't like it because there's two buttons. I asked my guild about making a cast sequence macro for it but they all seemed to think this was a very bad idea.

Do you know of any way to modify these macros into one button so that if I'm tanking Tenebron and Shadron I can spam the macro if need be to get control of of Shad without loosing my targeting on Tenebron, and to do the same thing when I'm tanking Shadron and Vesperon?

haeras said...

Well i am not macro expert.. but i know you can specify target name in cast command like.

/cast [target=Shad] Growl

So you should be able to make a castsequence macro like this.
/castsequence [target=Shad] Growl; [target=Shad] Faerie Fire (feral);

Kalon said...

I've made Part 2 of this macro wackiness and answered some of the questions there. :)

Seleria said...

WTB the addon...

There, I voted!