Readme for SetM1Reward.vbs

2004-12-26
by Watercooler Warrior
This code and the readme is hereby released into the public domain. The script is just a quick-and-dirty implementation of an algorithm based on a TLR post by Chips (http://www.lancersreactor.com/t/forum/topic.asp?topic_id=30979).

SetM1Reward.vbs is a Windows Script Host script written in VBScript that allows you to quickly reset the first mission reward money without directly editing INI files. This makes it useful for people who don't know anything about INI files or for those who want to automate it somehow when performing mod tests.

Using the Script: The simple way
Assuming all prerequisites are met, just double-click the script or a shortcut to it. When prompted for start money amount, enter a number.

========================================================
More Detailed Information

Prerequisites
You have to have Freelancer installed, and you MUST have the decompiled INI files, preferably from the Freelancer SDK or the unofficial Freelancer Patch.

Compatibilities
This should work fine before or after applying a mod using FLMM, except for mods which specifically look for the original reward money value. You can probably fix any problems you encounter by running this script and resetting the first mission reward money to its original value of 2000. This is the default value you are prompted with.

Commandline/Automated Use
You can automate this script pretty easily. To run it from the commandline (for example called in a batch file) run it with
	cscript SetM1Reward.vbs
If you specify a numeric value for the start money as a commandline argument, you will not be prompted: for example,
	cscript SetM1Reward.vbs 9000
If you want to also suppress all text messages for success or failure, use the /S switch. The following:
	cscript SetM1Reward.vbs /S 9000
would attempt to silently update the start money and exit without any GUI or text output.
The script will ALWAYS return an exit errorlevel, one that should be in the range of 0-5. Here's what the errorlevels mean.
0 - it worked.
1 - there is a syntax error in the script. This shouldn't happen unless the script is modified.
2 - the Missions\M01a\m01a.ini file couldn't be found or is empty.
3 - m01a.ini is a BINI file (actually, starts with BINI).
4 - The new money value you supplied is not numeric.
5 - The reward line couldn't be found in m01a.ini.