Feed/Mend/Revive Pet Macro

How would I tweak the following macro to revive my pet in or out of combat?

#showtooltip Mend Pet
/cast [nocombat] Feed Pet; [combat] Mend Pet
/use [nocombat] Raw Clefthoof Meat

Mend Pet and Revive Pet are part of the same complex of spells.

This might work:

/cast [nopet][@pet,dead]Revive Pet;[nocombat]Feed Pet;[combat]Mend Pet
/use [pet,nodead,nocombat]Raw Clefthoof Meat
2 Likes

No joy. It revives the pet but nothing else works on it, I figured it out though using a combination of the two :grin:

#showtooltip Mend Pet
/cast [nocombat] Feed Pet; [combat dead;nodead] Revive Pet;Mend Pet
/use [nocombat] Raw Clefthoof Meat

That won’t work as written. Missing comma between combat and dead, semi-colon in the middle of a conditional.

In my macro, Revive Pet will only work if the pet is dead or you don’t have one (Blizzard can’t always tell those two conditions apart - I’m assuming you have a call pet macro somewhere else).

If the pet is NOT dead or you have a pet then and only then the rest of it will run.

If you have a living pet and you’re not in combat, feed pet will run, then (assuming you can do “feed pet” and "use " in the same macro anyway) you’ll feed Raw Clefthoof Meat to it.

If you have a living pet and you’re in combat, Mend Pet will run.

I’m going to assume that this didn’t work because your care in copying my macro to your account was probably on par with your copying your macro into that post.

I’ll get a chance to test it later, though. I’m not on my gaming box right now.

It works that way but I do get an error message, found the problems and fixed it, thanks for the help. The Corrected macro is…

#showtooltip Mend Pet
/cast [nocombat] Feed Pet; [combat,dead,nodead] Revive Pet;Mend Pet
/use [nocombat] Raw Clefthoof Meat

This condition will never fire.

This is all you need

#showtooltip
/cast [nocombat,pet] Feed Pet; Revive Pet
/use [nocombat,pet] Raw Clefthoof Meat

If you have a pet out and you’re out of combat feed it. Otherwise revive/mend pet as needed.

What do you mean it will never fire? I have tested it several times now and it works Exactly as intended. I may be a Nub to creating Macros but I can usually tweak them to do what I want once I am pointed into the right direction. :grin:

1 Like

What’s happening is that you’ve got Revive Pet on an impossible condition followed by a default of Mend Pet.

Mend Pet and Revive Pet both cause the same spell to be executed at run time. They’re contextual.

That macro is badly malformed. You may be getting results out of it that seem to be what you want, but “dead,nodead” means “the unit is dead AND the unit is NOT dead” which is textbook “this will not execute”.

1 Like

In terms of a traditional logic structure, this is what you’ve done:

if I am NOT in COMBAT then
  Cast Feed Pet
else
  if *I am in COMBAT and my target is DEAD and my target is NOT DEAD* then
    Cast the Contextually Correct Pet Spell (Revive Pet or Mend Pet)
  else
    Cast the Contextually Correct Pet Spell (Revive Pet or Mend Pet)
  end
end

if I am NOT in COMBAT then
  Use Raw Clefthoof Meat
else
  take no action
end

The portion between the asterisks will never, ever evaluate as true.

But the fallback portion executes the exact same code.

This gives you the illusion that what you’ve done is working as intended, but it is not.

1 Like

I like my version because it accounts for that weird edge case where the macro API can’t tell the difference between pet dead or pet out-of-range.

/cast [nopet][@pet,dead]Revive Pet;[nocombat]Feed Pet;[combat]Mend Pet
/use [pet,nodead,nocombat]Raw Clefthoof Meat

Attempts to revive pet first if it is dead or maybe dead (whether in or out of combat).
Feeds pet if out of combat.
Mends pet if in combat.

Yes, Mend Pet and Revive pet are the same but for clarity, I coded it this way because this is how they should execute at run-time.

Oki, it was working yesterday but decided to go wonky today, thank you I will plug your macro in it’s place since I am sure you have had no problems with it. (Curtsies)

I use a far more complex system of interlinked macros for my hunter.

I think my normal targeted attacks go through five or six macros between first button click and final execution.

In order, it’s this:

On ElvUI_Bar5Button1, “Combat Mgmt”

#show
/dismount [mounted,mod]
/leavevehicle [vehicleui,mod]
/click ElvUI_Bar5Button2

On ElvUI_Bar5Button2, “Target PVE”

#show
/run if not (InCombatLockdown() or GetCVar("TargetPriorityPvp") == "2") then SetCVar("TargetPriorityPvp", 2, "scriptCVar") end
/click ElvUI_Bar5Button3

On ElvUI_Bar5Button3, “Target 2”

/cleartarget [dead][noharm][mod:ctrl]
/target [@mouseover,harm,nodead,mod:alt][@focustarget,harm,nodead,mod:shift]
/targetenemy [noharm][noexists]
/click ElvUI_Bar5Button4
/click ElvUI_Bar5Button5
/click ElvUI_Bar5Button6

On ElvUI_Bar5Button4 - Left open for encounter-level target priority macro
On ElvUI_Bar5Button5, “Misdirection”

#show Misdirection
/cast [nogroup:raid,group,@focus,help,nodead][@pet,exists,nodead]Misdirection

On ElvUI_Bar5Button6, “Pet Growl”

#show Growl
/petautocastoff [group:raid][group,@focus,help,nodead]Growl
/stopmacro [group:raid][group,@focus,help,nodead]
/petautocaston Growl

Then for the actual attack macro, this:
“Cobra Shot”

#show Cobra Shot
/click ElvUI_Bar5Button1
/cast [harm,nodead]Cobra Shot
/petassist
/petattack

For my pet management, this:

I have five macros all named exactly “Call Pet 1”, “Call Pet 2”, “Call Pet 3”, “Call Pet 4”, and “Call Pet 5”. They all look like this (swap out the “n” for the pet number).

#showtooltip Call Pet n
/cast [nopet,nomod:ctrl]Call Pet n

The whole process is driven by a single macro, “Pet Management”

#show
/click ElvUI_Bar5Button7
/click ElvUI_Bar5Button8
/click ElvUI_Bar5Button9
/click ElvUI_Bar5Button10

On ElvUI_Bar5Button7, this:

/run if not InCombatLockdown() then local t,C,D={883,83242,83243,83244,83245}for k,v in ipairs(t) do C=select(3,GetSpellInfo(v))D=((C and(C==132161 and(2178508+k)or C))or 133940)EditMacro("Call Pet "..tostring(k),nil,D,nil)end end

That just cleans up the icons on the macros so they match the ones appropriate for the pets they call rather than the generic whistle.
On ElvUI_Bar5Button8, whichever “Call Pet n” macro represents the pet you want to be using tactically. You can swap out macros by mouse action even during combat, so it’s easy to change your mind if you need to.
On ElvUI_Bar5Button9, “Pet Revive”

#show
/stopcasting [nochanneling,nopet,mod:ctrl] [nochanneling,@pet,dead]
/cast [nopet,mod:ctrl][@pet,dead]Revive Pet

On ElvUI_Bar5Button10, “Fetch/Follow/Fix”

#show
/stopmacro [nopet][@pet,dead]
/petfollow [mod:ctrl]
/petdefensive [nomod]
/petpassive [mod:alt]
/cast [mod:alt]Fetch;Mend Pet
1 Like

Not sure what 1/10 of all that means :rofl: I’m still using keyboard and a standard 2 button mouse. Thanks for the Macro help, so far it is doing as it should.

Should work with any keyboard and mouse. You’d need one row of buttons to hold the “clicked” macros is all and it doesn’t have to be visible (it can’t be one of the rows that is on the variable button row in the default UI is all).

What that lets me do is retarget intelligently, growl only when needed, misdirect to my focus when assigned (I always put my tank in focus unless he or she needs my pet to off-tank, then I leave the focus empty - except in raids - raids I just don’t autogrowl), fetch with my pet, heal or call my pet as needed, and force my pet in to follow mode if I’ve done a petmoveto or petstay somewhere.

This would essentially accomplish the same as:

#showtooltip
/cast [nocombat,@pet,exists,nodead] Feed Pet; Revive Pet
/use [nocombat,@pet,exists,nodead] Raw Clefthoof Meat

Not quite, Elvie.

Attempting to revive a pet prior to doing anything else means that you get immediate feedback on the tooltip about whether or not your pet is dead (or Blizzard THINKS it’s dead) and you need to know that in or out of combat.

It’s six of one half-a-dozen of the other, really, but I find this more clear and easier to fit into a calling chain when necessary.

If I use this can I take out the feed pet part?? I just need mend and revive.
If no do I just leave as is or is there a different way?
Thanks. :blush:

Revive Pet automatically changes into Mend Pet when you pet is alive. Just stick the actual spell on your bars unless you’re using a more complex macro.

This is incorrect as of 10.2, due to a bug.

I’d recommend this macro:
#showtooltip
/use [nocombat,@pet,pet,nodead]Feed Pet;[@pet,dead][nopet,mod:alt]Revive Pet;Mend Pet

3 Likes

Looks like you’ve got a , near the end instead of a ;

2 Likes