Log in

View Full Version : Hunter Pet Control Macro



Tehtsuo
07-01-2009, 10:25 AM
Hey all, I'm looking to write this macro for my hunter. I've had it working before, but lost it since then. Here's what I want it to do, all on one button, with NO MODIFIER KEYS:

If my pet is idle, and I have something targetted, send the pet to attack the target
If my pet is idle, and I have my mouse over a unit, send the pet to attack the target
If my pet is attacking, and I have something else targeted, tell the pet to change targets to match my target
If my pet is attacking, and I have something under my mouse, tell the pet to change targets to my mouseover target
If my pet is attacking, and I have the mob it is attacking targeted, and nothing under my mouse, tell my pet to follow me
If my pet is attacking, and I have nothing targeted, and nothing under my mouse, tell my pet to follow me

I know this sounds really complex and way too multifunction to fit into one macro with no modifier keys, but I know that I've had it working before, it just required a lot of conditionals set up a specific way.

ElectronDF
07-01-2009, 10:51 AM
You can check for your combat status, but you can't check for your pets combat status. You can check for your pet's target though.
/petattack [target=player-pet-target, noexists] (this assumes you have a target, so first condition)

The problem with mouseover is it is part of a target, so can't check pet target and attack a different target without getting fancy. So might just be safer to just assume the pet has put you in combat.
/petattack [target=mouseover, exists, nocombat] (in other words, pet won't go if you are in combat, should be 2nd condition)

/petattack (just makes pet attack whatever you have targeted, so can put in empty conditions [ ], should be 3rd, no reason to check for combat, since it is the same as 1st condition)

/petattack [target=mouseover, exists] (should be 4th, again, no reason to check for combat, since it is the same as 2nd)

1st and 3rd also 2nd and 4th are the same (unless I am missing something) If you have a target, make pet attack, sure you can check if on a Tuesday, but the result is the same. If you have a mouseover, make pet attack, again, you can check if the target is a humanoid, but still same result.

Why not just use the keybind for petpassive (CTRL-0)? Just push it and pet comes to you and does nothing, which sounds like 5th. But oh well.
/petpassive [target=mouseover, noexists] (again, doens't matter if you check the color the the targets shoulder armor, result is pet comes to you if no mouseover)

Again would use keybind for petpassive, but you have to remember to turn it back off in your attack macro. Just use /petdefensive to make pet normal. Also, 5 and 6 are the same (unless I am missing something). It doesn't matter if you check for the stars in the sky, no mouseover, petpassive.
/petpassive [target=mouseover, noexists]

If I am not understanding what you are asking, I am sorry. I just try to boil things down the basic items. I also have a petattack and petfollow keys (I use F1 and F2) since I use a lot of pet classes. But they are the same as CTRL-1 and CTRL-2, just easier for my fingers and muscle memory at F1, F2. I also put /petattack [target=focus-target] on my alts so the pets always attack what my main is attacking, no matter what they were attacking before. No target on my main, no attack. Yeah, the pets will still finish off whatever they had targeted, but I just push the follow key (CTRL-2) or just run out of range (BG's).

Hope that helps and good luck.

asonimie
07-01-2009, 11:19 AM
/petattack [target=mouseover,exists,nodead][]

This takes care of everything except the last 2 lines (combat follow)

Its early and I'm hungover but hopefully that helps.

Tehtsuo
07-01-2009, 11:42 AM
/petattack [target=mouseover,exists,nodead][]

This takes care of everything except the last 2 lines (combat follow)

Its early and I'm hungover but hopefully that helps.Yeah I think I got that far and it works well. Like you said, the problem is the follow
I think I tried the following:

/petattack [target=mouseover,exists,nodead][]
/petfollow [target=pettarget,exists]

Which works to a point. The problem is, to change targets, you have to press it twice - it makes the pet switch to following you, which clears its target, then the next press turns the attack back on the correct target, either the new target or your mouseover target. I do want mouseover to take precedence over your actual target, so the petattack portion works perfectly. What I need is an 'AND' boolean operator for the condition, which I'm not sure how I did before, like so:

/petfollow [target=pettarget,exists AND mouseover,noexists]

I think I'll try this tonight to see if it works, but I think it'll function more like an 'OR' operator:

/petfollow [target=pettarget,exists][mouseover,noexists]

Tehtsuo
07-01-2009, 12:27 PM
By golly I think I got it! Someone on the UI/Macros forum gave me the idea of using conditionals in a stopmacro. I think this is what I'm looking for:

/petattack [target=mouseover,exists,nodead][]
/stopmacro [target=mouseover, exists]
/petfollow [target=pettarget,exists]

The only thing I'm not sure is if I choose a different target and don't have something under my mouse, I think it would set it to follow. I wonder if I can add another condition into the stopmacro if my target does not equal my pet's target...


edit: Actually, there's a good chance it'll work. I'm going to test it tonight before I over-think it.