VXAce Remember Command

In RPG Maker MV one of the coolest base additions for a player in my opinion was the game remembering what your previous command was and blowing through them very quickly when your selection button was held.
Is there a script version of this for VXA?
If so can I have it!

-Axel
Something like this?

Ruby:
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
  attr_accessor :last_battle_command
end #Game_Battler

#==============================================================================
# Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # overide method: call_ok_handler
  #--------------------------------------------------------------------------
  def call_ok_handler
    @actor.last_battle_command = current_symbol if handle?(current_symbol)
    super
  end
 
  #--------------------------------------------------------------------------
  # override method: activate
  #--------------------------------------------------------------------------
  def activate
    r = super
    select_last
    return r
  end
 
  #--------------------------------------------------------------------------
  # new method: select_last
  #--------------------------------------------------------------------------
  def select_last
    select(0)
    return unless @actor
    cmd = @actor.last_battle_command
    select_symbol(cmd) if cmd
    if cmd == :skill
      skill = @actor.last_skill.object
      select_ext(skill.stype_id) if skill
    end
  end
end #Window_ActorCommand

The select_last code is basically the same as the method in MV's version.
Something like this?

Ruby:
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
  attr_accessor :last_battle_command
end #Game_Battler

#==============================================================================
# Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # overide method: call_ok_handler
  #--------------------------------------------------------------------------
  def call_ok_handler
    @actor.last_battle_command = current_symbol if handle?(current_symbol)
    super
  end
 
  #--------------------------------------------------------------------------
  # override method: activate
  #--------------------------------------------------------------------------
  def activate
    r = super
    select_last
    return r
  end
 
  #--------------------------------------------------------------------------
  # new method: select_last
  #--------------------------------------------------------------------------
  def select_last
    select(0)
    return unless @actor
    cmd = @actor.last_battle_command
    select_symbol(cmd) if cmd
    if cmd == :skill
      skill = @actor.last_skill.object
      select_ext(skill.stype_id) if skill
    end
  end
end #Window_ActorCommand

The select_last code is basically the same as the method in MV's version.

That works beautifully, is there a way to implement the automash (it may be a yanfly thing, not sure. I just know it was in an MV game I did play) and make this togglable via switch? So I can throw that into my options menu.

(Edit: It may be a better idea to have the automash as a 2nd script for compatibility)
Sorry, what do you mean by automash?
Sorry, what do you mean by automash?
When the action button is held for long enough, it automatically mashes/goes through all menus, which I just checked is something built into MV by default.
I wrote a base script to have your automash.
You can replace the code from self.enabled? or just set the value of SWITCH_ID to fit your automash option.
Ruby:
#==============================================================================
# AutoMash
#==============================================================================
module AutoMash
  #put a value above 0 to have a switch allow the automash when true
  SWITCH_ID = 0 
  
  def self.enabled?(key)
    SWITCH_ID > 0 ? $game_switches[SWITCH_ID] : true
  end
end #AutoMash

#==============================================================================
# Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # overwrite method: process_handling
  #--------------------------------------------------------------------------
  def process_handling
    return unless open? && active
    return process_ok       if ok_enabled?        && check_input(:C)
    return process_cancel   if cancel_enabled?    && check_input(:B)
    return process_pagedown if handle?(:pagedown) && check_input(:R)
    return process_pageup   if handle?(:pageup)   && check_input(:L)
  end
  
  #--------------------------------------------------------------------------
  # new method: check_input -> allow to switch between repeat or trigger based
  # on module option
  #--------------------------------------------------------------------------
  def check_input(key)
    AutoMash.enabled?(key) ? Input.repeat?(key) : Input.trigger?(key)
  end
end #Window_Selectable
I wrote a base script to have your automash.
You can replace the code from self.enabled? or just set the value of SWITCH_ID to fit your automash option.
Ruby:
#==============================================================================
# AutoMash
#==============================================================================
module AutoMash
  #put a value above 0 to have a switch allow the automash when true
  SWITCH_ID = 0
 
  def self.enabled?(key)
    SWITCH_ID > 0 ? $game_switches[SWITCH_ID] : true
  end
end #AutoMash

#==============================================================================
# Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # overwrite method: process_handling
  #--------------------------------------------------------------------------
  def process_handling
    return unless open? && active
    return process_ok       if ok_enabled?        && check_input(:C)
    return process_cancel   if cancel_enabled?    && check_input(:B)
    return process_pagedown if handle?(:pagedown) && check_input(:R)
    return process_pageup   if handle?(:pageup)   && check_input(:L)
  end
 
  #--------------------------------------------------------------------------
  # new method: check_input ->
[QUOTE="Timtrack, post: 1549330, member: 36313"]
Something like this?

[CODE=ruby]#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
  attr_accessor :last_battle_command
end #Game_Battler

#==============================================================================
# Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # overide method: call_ok_handler
  #--------------------------------------------------------------------------
  def call_ok_handler
    @actor.last_battle_command = current_symbol if handle?(current_symbol)
    super
  end
 
  #--------------------------------------------------------------------------
  # override method: activate
  #--------------------------------------------------------------------------
  def activate
    r = super
    select_last
    return r
  end
 
  #--------------------------------------------------------------------------
  # new method: select_last
  #--------------------------------------------------------------------------
  def select_last
    select(0)
    return unless @actor
    cmd = @actor.last_battle_command
    select_symbol(cmd) if cmd
    if cmd == :skill
      skill = @actor.last_skill.object
      select_ext(skill.stype_id) if skill
    end
  end
end #Window_ActorCommand

The select_last code is basically the same as the method in MV's version.

I replied to the wrong thing. Meant the first code thing.
You able to add a switch toggle to this one too? Tried adding a return if switch true but it didn’t reset skills position.
You can replace the call to select_last in the activate method to have a switch requirement:
Ruby:
module MemoryBattleCommand
  SWITCH_ID = 0
 
  def self.enabled?
    SWITCH_ID <= 0 || $game_switches[SWITCH_ID]
  end
end #MemoryBattleCommand

#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
  attr_accessor :last_battle_command
end #Game_Battler

#==============================================================================
# Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # overide method: call_ok_handler
  #--------------------------------------------------------------------------
  def call_ok_handler
    @actor.last_battle_command = current_symbol if handle?(current_symbol)
    super
  end
 
  #--------------------------------------------------------------------------
  # override method: activate
  #--------------------------------------------------------------------------
  def activate
    r = super
    select_last if MemoryBattleCommand.enabled?
    return r
  end
 
  #--------------------------------------------------------------------------
  # new method: select_last
  #--------------------------------------------------------------------------
  def select_last
    select(0)
    return unless @actor
    cmd = @actor.last_battle_command
    select_symbol(cmd) if cmd
    if cmd == :skill
      skill = @actor.last_skill.object
      select_ext(skill.stype_id) if skill
    end
  end
end #Window_ActorCommand
You’re amazing as always my man. I feel like this will speed up my game so much.
Did want to come back to add on. At least for me, the game would lag behind if the auto mashed button was held during Actor/Battler Actions so I added in something of a modification to hopefully help, my pc is very low end so, it was something I think I should add.
Code:
def check_input(key)
  AutoMash.enabled?(key) ? Input.repeat?(key) : Input.trigger?(key) unless BattleManager.in_turn?
end

Original thread: https://forums.rpgmakerweb.com/threads/remember-command.182677/