SKYRIM
Automatic Batch File Execution - ZAutoExec by Kvalyr
Skyrim » Utilities
Added: 03/01/2012 - 01:39PM
Updated: 27/03/2012 - 09:05PM

31 Endorsements

2.2.524 Latest version

1,263 Unique D/Ls

1,876 Total D/Ls

12,486 Total Views

Uploaded by Kvalyr

Description

Last updated at 21:05, 27 Mar 2012 Uploaded at 13:39, 3 Jan 2012

=====================================================================================
= ZAutoExec - Auto-Execute Batch File v2.2.524 for TES V: Skyrim V1.5.24.0
= Copyright (c) Kvalyr - 2012
=====================================================================================
= Requires ScriptDragon by Alexander Blade
=====================================================================================

================
Download:
========

Plugin:
http://www.skyrimnexus.com/downloads/file.php?id=5217

Script Dragon (Required):
http://alexander.sannybuilder.com/?category=other&altname=skyrim_script_dragon

BethSoft Thread:
http://forums.bethsoft.com/topic/1328047-rel-zautoexec-automatic-batch-file-execution/

================
Features:
========

+ Run Skyrim command batch files automatically during gameplay:

- Supports any standard Skyrim batch file (.txt).
- Can execute multiple batch files together or in sequence.
- Supports batch files of virtually any length by using a custom parsing
function instead of Skyrim's own bat command.
- Works without user intervention once configured.

+ Optional repeating execution of batch files:

- Each batch file can be assigned an interval in milliseconds on which it
executes repeatedly.
- Theoretically supports an unlimited number of batch files in sequence or
simultaneously. (Limited to 64 for practicality! Can be changed if needed)

+ Optional Delayed Execution:

- User-specified delay (in milliseconds) before running any batch files.

+ Flexibility:

- Useful for building a rebalance/tweaking mod without creating .esp files
or worrying about conflicts/compatibilities.
- Can be used in combination with other mods that tweak game settings as
a way to 'override' values, since batches are executed after mods have
been loaded.

+ Speed:

- Written in C++ as a ScriptDragon plugin, which means it should be faster
and more efficient than doing the same kind of work in Papyrus scripts etc.
The difference is probably negligible, but it could matter in some cases.

================
Description:
========

Skyrim natively supports batch files to execute multiple console commands from a single file
or to alias complicated commands by placing them in a batch file with a shorter name.
This is normally achieved by writing the commands into a text file in the Skyrim directory and
then executing the batch file by typing "bat [filename]" in-game.

Unfortunately, Skyrim does not appear to have a facility for automatically executing these batch
files at startup. This ScriptDragon plugin is an attempt to provide that functionality.

This can be useful for doing things like changing certain game settings to adjust game balance
without using a mod/esp, or adjusting game settings that don't show up as GMSTs in the editor.
(eg; fWeaponTwoHandedAnimationSpeedMult)

ZAutoExec is a simple plugin that imitates this batch-command functionality by reading commands
from a text file and sending them to the console as if they had been typed by the player.
The plugin will always execute the specified batch files at least once each, but can also be
configured to repeatedly execute the batch commands at an interval in milliseconds specified
by the user in ZAutoExec.ini.

The default interval is set to 60'000 milliseconds (1 minute) so that the batch file is
executed once every minute, but that value can be adjusted freely.

================
Requirements:
=======

- Skyrim v1.5.24.0
- ScriptDragon v1.5.24.0

Compatibility with any other versions of either SD or Skyrim is not guaranteed or supported
whatsoever.

================
Installation:
=======

1. Extract the contents of the zip file to your Skyrim folder.
- The files ZAutoExec.txt, ZAutoExec.asi and ZAutoExec.ini should end up in the same
folder as TESV.exe and SkyrimLauncher.exe

2. Edit the ZAutoExec.txt file in any text editor and add console commands that you want to
be executed automatically in-game.
eg (without quotes); "setgs fWeaponTwoHandedAnimationSpeedMult 1.85"

3. [Optional] Edit ZAutoExec.ini in a text editor and change the value after "interval="
to another value to change how often the batch file is executed.

The default interval of 60000 (milliseconds) means that the batch file is executed once
every minute.

An interval of 0 will cause the batch file to be executed just once after loading the game
(or after loading a saved game), instead of executing it repeatedly as per the interval.

4. [Optional] Edit ZAutoExec.ini in a text editor and change the value after "batch="
to specify a different batch file to execute instead of AutoExec.txt.
The plugin expects plain text (.txt) files. The setting can be specified with or
without the file extension.

5. [Optional] Add extra batch files for execution by specifying:
batch1=...
interval1=...

batch2=...
interval2=...
etc.

================
Optional Files:
========

Also available on SkyrimNexus alongside this plugin are some example batch files to
demonstrate the functionality of the plugin.

The 2H weapon speed file is what I originally wrote this plugin for, since I wanted
faster 2H Weapons in my game but without having to modify the weapons in-game and
risking incompatibilities with other mods or patches; but I also didn't want to
have to enter a command into the console every time I loaded my game.

The contents of the example files can be placed into the ZAutoExec.txt (or any other
batch file) alongside other valid Skyrim console commands to be executed.

================
Planned Features:
========

- Add optional verbose feedback messages and other user-controlled settings
- Hotkeys. Player should be able to assign hotkeys to specific batch files.
- Source code release (eventually)

================
Performance:
=======

ZAutoExec is generally lightweight but executing a large number of long batch files
at an interval of 1ms could potentially slow the game down. This hasn't been tested!

Otherwise, this plugin should have minimal discernible impact on game performance.

================
Credits:
=======

- Alexander Blade for ScriptDragon
- Bethesda for Skyrim
- Robin Scott for the Nexus Network
- The PC game modding community as a whole

- This plugin uses libraries from Poco ( www.pocoproject.org ) for INI-parsing and
string-handling.

================
Redistribution, Licence & Disclaimer:
=======

Modifications of this script are allowed only where this notice is included, the author's
copyright is acknowledged and credit is given to the original author of the script (Kvalyr).

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================
Change Log:
=======
v2.2.524
- Updated for V1.5.24.0

v2.2.427
- Updated & Recompiled for V1.4.27.0

v2.2
- Updated & Recompiled for V1.4.21.0
- Changed console command ref handle to 0

v2.1
- Made the ini parser safer. (Should fix crashes on invalid batchfile names)
- Improved memory efficiency
- Fixed a tiny memory leak

v2.0
- Rewritten in C++ style. Core functionality encapsulated in 2 classes.
- Support for multiple batch files & batch file sequencing.
- Delayed execution feature.
- Removed 'repeat' switch, replaced with interval = 0.

v1.2
- Added custom batch parse/execution function
* No longer uses Skyrim's native system to avoid problems with execution and
user intervention (opening the console, etc.).
- Added user-specified batch file option
- Implemented custom ini-reading code using Poco libraries.
- Fixed line-endings bug (hopefully). Line endings shouldn't matter any more.
- Improved error-checking for invalid ini options

v1.1b
- Added code to check for invalid values from the ini file.

v1.1
- Made repeating auto-execution optional using the 'repeat' switch
in ZAutoExec.ini

v1.0
- Initial Release

=====================================================================================