by Dargor
Version 1.2
Introduction
I made this little script a while ago and I forgot to post it.
It adds an Auto Battle command to the party command window and will make the whole party attack automatically.
Hope you like it!
Script
Code:
#==============================================================================
# ** Auto Battle
#------------------------------------------------------------------------------
# © Dargor, 2008
#Â 13/05/08
#Â Version 1.2
#------------------------------------------------------------------------------
#Â VERSION HISTORY:
#Â - 1.0 (24/03/08), Initial release
#Â - 1.1 (13/05/08), Added auto-battle modes (Single Turn/Whole Battle)
#Â - 1.2 (13/05/08), Added auto-battle cancelation (use SHIFT)
#------------------------------------------------------------------------------
#Â INSTRUCTIONS:
#Â 1) Paste the script above main
#Â 2) To change an actor's auto battle option, use:
#Â Â Â Â $game_actors[actor_id].auto_battle = true/false
#Â 3) To enable/disable the auto battle option, useL
#Â Â Â Â $game_system.auto_battle_disabled = true/false
#==============================================================================
# Vocabulary: Auto Battle Command
Vocab::AutoBattle = 'Auto'
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#Â This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :auto_battle_disabled
 attr_accessor :auto_battle_mode
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_system_auto_battle_initialize initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  @auto_battle_disabled = false       # Enable/Disable flag
  @auto_battle_mode = 0           # 0: Single Turn 1: Whole Battle
  dargor_vx_system_auto_battle_initialize
 end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#Â This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :in_auto_battle        # in-battle flag
 attr_accessor :auto_battle_canceled
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_temp_auto_battle_initialize initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  @in_auto_battle = false
  @auto_battle_canceled = false
  dargor_vx_temp_auto_battle_initialize
 end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#Â This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :auto_battle
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_actor_auto_battle_setup setup
 #--------------------------------------------------------------------------
 # * Setup
 #  actor_id : actor ID
 #--------------------------------------------------------------------------
 def setup(actor_id)
  actor = $data_actors[actor_id]
  @auto_battle = actor.auto_battle
  dargor_vx_actor_auto_battle_setup(actor_id)
 end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#Â This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_battle_auto_battle_update_basic update_basic
 alias dargor_vx_battle_auto_battle_create_info_viewport create_info_viewport
 alias dargor_vx_battle_auto_battle_start_party_command_selection start_party_command_selection
 alias dargor_vx_battle_auto_battle_update_party_command_selection update_party_command_selection
 alias dargor_vx_battle_auto_battle_process_victory process_victory
 #--------------------------------------------------------------------------
 # * Basic Update Processing
 #  main : Call from main update method
 #--------------------------------------------------------------------------
 def update_basic(main = false)
  if Input.trigger?(Input::SHIFT)
   $game_temp.in_auto_battle = false
   $game_temp.auto_battle_canceled = true
  end
  dargor_vx_battle_auto_battle_update_basic(main)
 end
 #--------------------------------------------------------------------------
 # * Create Information Display Viewport
 #--------------------------------------------------------------------------
 def create_info_viewport
  commands = $game_system.party_commands
  $game_system.add_party_command(commands.size-1, Vocab::AutoBattle)
  dargor_vx_battle_auto_battle_create_info_viewport
  index = commands.index(Vocab::AutoBattle)
  @party_command_window.draw_item(index, !$game_system.auto_battle_disabled)
 end
 #--------------------------------------------------------------------------
 # * Start party command selection
 #--------------------------------------------------------------------------
 def start_party_command_selection
  if $game_system.auto_battle_mode == 1 && $game_temp.in_auto_battle
   for actor in $game_party.members
    actor.make_action
   end
   start_main
   return
  end
  dargor_vx_battle_auto_battle_start_party_command_selection
 end
 #--------------------------------------------------------------------------
 # * Update Party Command Selection
 #--------------------------------------------------------------------------
 def update_party_command_selection
  dargor_vx_battle_auto_battle_update_party_command_selection
  if Input.trigger?(Input::C)
   case $game_system.party_commands[@party_command_window.index]
   when Vocab::AutoBattle # Auto Battle
    if $game_system.auto_battle_disabled
     Sound.play_buzzer
     return
    end
    if $game_system.auto_battle_mode == 1
     $game_temp.in_auto_battle = true
    end
    for actor in $game_party.members
     actor.make_action
    end
    Sound.play_decision
    start_main
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Victory Processing
 #--------------------------------------------------------------------------
 def process_victory
  $game_temp.in_auto_battle = false
  dargor_vx_battle_auto_battle_process_victory
 end
end
Notes
The script requires my Custom Commands script.
And as always, don't forget to give me credit!
-Dargor