Been too long since I played with pet stuff, but there is the game function UsePetAction() that will use one of the pet's action bar buttons as if you clicked it. To use, just provide the pet action bar slot number (1-10) to this function.
For example, if you wanted to use the action 6 on the pet's action bar you would use this for your macro:
|
Source code
|
1
|
/run UsePetAction(6)
|
Oh yeah, forgot to mention. You can provide a second parameter to this function to simulate right-clicking the action bar. Use a value of true to simulate a right-click on the button, while a value of false (or no value at all) will simulate left-clicking the button.
For example, to perform a right-click on this same action button 6, you would use:
|
Source code
|
1
|
/run UsePetAction(6, true)
|