MZ Auto battler that allows target selection

So, my issue is basically what the title says.
I want to create an auto battle system in MZ where all player actors always and automatically use the standard attack (no items, escape, guard or skills) but it's left to the player which enemy they want to target.

I know I could simply seal all other skills and only allow the standard attack to be selectable but that's a really inelegant solution that forces the player to go through two menus where they can't chose anything. So, I figured there must be a better way. I managed to force an actor action a couple of times, but this always came with random targeting as well. So I was hoping that someone here might have an idea how I can force the player actor to use the standard attack but leave the target selection to the player themselves.

Thank you very much for any input.
If you want a simple solution, I think you can just add 1 line of code to startActorCommandSelection function for it to automatically process ok (since it starts on the attack command). I also set the width of actor command window to 0, so it isn't visible. In addition to these, search for a plugin that skips the party command window, you should be able to find one here (with just the below ones you'd still need to select fight from party command window).

Scene_Battle.prototype.startActorCommandSelection = function() {
this._statusWindow.show();
this._statusWindow.selectActor(BattleManager.actor());
this._partyCommandWindow.close();
this._actorCommandWindow.show();
this._actorCommandWindow.setup(BattleManager.actor());
this._actorCommandWindow.processOk(); // EXTRA LINE ADDED HERE
};

Scene_Battle.prototype.actorCommandWindowRect = function() {
const ww = 0;
const wh = this.windowAreaHeight();
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
const wy = Graphics.boxHeight - wh;
return new Rectangle(wx, wy, ww, wh);
};
If you want a simple solution, I think you can just add 1 line of code to startActorCommandSelection function for it to automatically process ok (since it starts on the attack command). I also set the width of actor command window to 0, so it isn't visible. In addition to these, search for a plugin that skips the party command window, you should be able to find one here (with just the below ones you'd still need to select fight from party command window).

Scene_Battle.prototype.startActorCommandSelection = function() {
this._statusWindow.show();
this._statusWindow.selectActor(BattleManager.actor());
this._partyCommandWindow.close();
this._actorCommandWindow.show();
this._actorCommandWindow.setup(BattleManager.actor());
this._actorCommandWindow.processOk(); // EXTRA LINE ADDED HERE
};

Scene_Battle.prototype.actorCommandWindowRect = function() {
const ww = 0;
const wh = this.windowAreaHeight();
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
const wy = Graphics.boxHeight - wh;
return new Rectangle(wx, wy, ww, wh);
};
Thank you very much.
It works beautifully.

Only minor hiccup is that, if you press cancle while in the target selection of the first actor, it takes you back to the now invisible fight menu (where you select attack, skill, etc.) Could get players stuck if not addressed, but that doesn't matter for my idea. So again, thank you.
Oh yeah, try adding:

Window_BattleEnemy.prototype.processCancel = function() {

};

Original thread: https://forums.rpgmakerweb.com/threads/auto-battler-that-allows-target-selection.180001/