Anything that delays or automates the actions is considered botting.

Every action must be linked to an independent keystroke. So in your case, you would make one for the pet attack and then one for the caster attack.

I can't stress this enough. If Blizzard detect it, they will ban you.