I just started to make my own macros and I’ve had to do a bunch of research to really try and understand what I need to do to make a macro that really gets close to I want my toon to do. This one is for warlocks, and might work for hunters, though I haven’t tried it yet. If your a warlock and looking for mor control of your pet this is the macro that I use:
#showtioltip summon imp
/petfollow [@pettarget,exists][]
/petattack [@mouseover,harm,nodead][@target,harm,nodead]
/petstay [mod]
Like I said I just started. This seems to work really well for me. I am able to have it attack my target or attack a target I mouseover or have it follow me if I click my macro When targeting a neutral area on the screen. And then I can have it stay Put by pressing the button with any mod key (Ctrl,shift,or alt) if there is a better way, please let me know, but this has been working for me.