Ya, I guess if that's the command to make the pet attack, but I was thinking more like making the pet go into battle first before the main character actually does any action.
PetAttackTarget is function in the CC, I don't know which one you are looking in? In the same file(I'm right) there is also a funtion. But I think it is almost the same as Lua.DoString("PetAttack()");