= BAIN Wizards ====================================================================#
<table><tr valign="top"><td></td></tr><tr valign="top"><td style='border: 1px solid #000000; padding: 5px; background: #e6e64c; width: 20%;'>
<a href="http://validator.w3.org/check?uri=http%3A%2F%2Foblivionworks.svn.sourceforge.net%2Fviewvc%2Foblivionworks%2FPrograms%2FWrye%20Bash%2FMopy%2Fwizards.html"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>

=== Contents
{{CONTENTS=3}}
{{CONTENTS=3}}
</td><td style="border: 1px solid #000000; padding: 5px; background: #f6f68c;">
= Introduction

Starting with Wrye Bash version 278, wizards were added to make it easier to install BAIN packages.  Wizards allow modders to include a simple configuration script with their packages.  All that needs to be done is create a script file name __wizard.txt__ and include it in the package.  When run, the wizard will step through a series of dialogs to determine which sub-packages, esps, and esms should be selected.  Afterwards, you can install the package using those selections.

== Dialogs
These are the dialogs that are may be shown while running a wizard.  The different ways you might encounter them are listed below.

=== SelectOne
This [[bash/images/selectone.jpg|dialog]] gives you a list of options, with the option to select one of them.  It will be shown when a [[#SelectOne1|[color=blue]SelectOne[/color]]] keyword is used.  Each option can display an image associated with it, and a description as well.  To see a larger version of the image displayed, either right click or middle click on the image.  The wizard can specify a default answer, and if you are running it as an Auto-Wizard, then this page will be skipped, using the default option.

=== SelectMany
This [[bash/images/selectmany.jpg|dialog]] gives you a list of options, with the option to select one or more of them, or even none of them.  It will be shown when a [[#SelectMany1|[color=blue]SelectMany[/color]]] keyword is used.  Each option can display an image associated with it, and a description as well.  To see a larger version of the image displayed, either right click or middle click on the image.  The wizard can specify default options, and if you are running it as an Auto-Wizard, then this page will be skipped, using the default options.

=== Versions
This [[bash/images/versions.png|dialog]] will show up if the wizard specified minimum version requirements, and your system doesn't meet those requirements.  It will be shown if a [[#RequireVersions|[color=blue]RequireVersions[/color]]] check fails.  If you want to run the wizard anyway, you can override the warning by clicking the "Install Anyway." option, however this is not recommended.  If you are running the wizard as an Auto-Wizard, this page will still be shown, but the "Install Anyway." option will already be checked for you.

=== Cancel
This [[bash/images/cancel.png|dialog]] will be shown if the wizard cancels execution for some reason, activated by the [[#Cancel1|[color=blue]Cancel[/color]]] keyword.  If a reason is given, it will be displayed

=== Error
This [[bash/images/error.jpg|dialog]] will be shown if the wizard encounters an error in the wizard file.  The wizard will then quit.

=== Finish
This [[bash/images/finish.png|dialog]] will be shown at the end of the wizard, to show you which sub-packages, esps, and esms will be selected.  It will be shown either when the end of a wizard file is reached, or if the [[#Return|[color=blue]Return[/color]]] keyword is used.  It also shows what INI Tweaks will be applied, and also serves as a place for any extra notes from the mod auther to be displayed.

== The language
BAIN wizards use a language similar to OBMM script, so modders familiar with OBMM should be able to quickly write BAIN versions of their scripts.

Wizards are case sensitive, so ensure you get the case right.  The only exception to this is filenames.

Each line of the wizard contains one statement.  If you want to continue the line onto the next one, just add a __backslash ( \ )__ to the end of the line.  This will cause BAIN to read the next line as is it were part of the first.

=== Variables
You can use variables by assigning a value using an [[#Operators|assignment operator]].  Just make sure you assign a value before using a variable, or it can cause undefined behavior.  In the best case, the variable will just be treated as a string with the same value as its name, but this is not guaranteed.

Variable names can contain any alpha-numeric characters (a-z,A-Z,0-9) and underscores ( _ ), but cannot start with a digit.  You also cannot create a variable with the same name (case sensitive) as a [[#Keywords|keyword]], [[#Functions|function]], or [[#Constants|constant]].  Variables can be used to hold any of the following types of data:
* **Integers**
  * 3
  * -1
  * 0
* **Decimals**
  * 0.123
  * -3.5
  * 7.0
* **[[#Strings|Strings]]**
  * "Hello"
  * 'World!'

=== Constants
Constants are a sub-type of variables.  They follow the same rules, only they cannot be changed.  You cannot create constants yourself, but there are a few pre-defined constants in BAIN.

=== Expressions
BAIN will evaluate expressions following the correct order of operations.  For example the expression:

[codebox]3 + 6 * 2[/codebox]

Will evaluate to __15__ as expected, not __18__.

=== Strings
Strings can be denoted by enclosing the text in either single quotes ( ' ), or double quotes ( " ).  If you need to include a special character in the string, use an escape sequence.  Strings can be added and multiplied using the addition and multiplication [[#Operators|operator]].  You can also test if one string is contained within another using the [[#Operators|in operator]].

=== Comments (;)
Comments are extra text ignored by the wizard engine, to explain what is going on in the code to other people who might read the wizard file.  To start a comment, use a semi-colon; the comment will include everthing following the semi-colon until the end of the line.

= Functions

Functions are called just like in any other language, using the function name followed by arguments inclosed in parenthesis.  Arguments must be seperatred by a comma.  For example:

[color=purple]DummyFunction[/color](~~arg1~~, [color=brown]"Hello"[/color])

== CompareObVersion
Used to test the installed version of Oblivion against one you specify.

* __Usage:__
  [codebox]CompareObVersion(version_string)[/codebox]
* __Arguments:__
  * **version_string:** a string formatted to hold a file version number, like "1.2.3.93".  For example the current Oblivion version would be represented as "1.2.0.416"
* __Return:__
  * **-1:** Installed Oblivion version is less than the version specified in **version_string**.
  * **0:** Installed Oblivion version is the same as the version specified in **version_string**.
  * **1:** Installed Oblivion version is higher than the version specified in **version_string**.

== CompareOBSEVersion
Used to test the installed version of [[http://obse.silverlock.org/|OBSE]] against one you specify.

* __Usage:__
  [codebox]CompareOBSEVersion(version_string)[/codebox]
* __Arguments:__
  * **version_string:** a string formatted to hold a file version number, like "1.2.3.93".  For example OBSE v18 would be represented as "0.0.18.6"
* __Return:__
  * **-1:** Installed OBSE version is less than the version specified in **version_string**.
  * **0:** Installed OBSE version is the same as the version specified in **version_string**.
  * **1:** Installed OBSE version is higher than the version specified in **version_string**.

== CompareOBGEVersion
Used to test the installed version of OBGE against one you specify.  If the [[http://www.tesnexus.com/downloads/file.php?id=30054|new version]] of OBGE/OGE is installed, this will be used for the comparison.  Otherwise, this will be compared to the [[http://timeslip.users.sourceforge.net/obge.html|old version]] or [[http://www.tesnexus.com/downloads/file.php?id=25912|debugged version]] if installed.

* __Usage:__
  [codebox]CompareOBGEVersion(version_string)[/codebox]
* __Arguments:__
  * **version_string:** a string formatted to hold a file version number, like "1.2.3.93".  For example OBGEv2 version 3 would be represented as "3.0.0.0", while the old OBGE would be "0.1.1.0"
* __Return:__
  * **-1:** Installed OBGE version is less than the version specified in **version_string**
  * **0:** Installed OBGE version is the same as the version specified in **version_string**
  * **1:** Installed OBGE version is higher than the version specified in **version_string**

== CompareWBVersion
Used to test the current version of Wrye Bash agains one you specify.

* __Usage:__
  [codebox]CompareWBVersion(version_number)[/codebox]
* __Arguments:__
  * **version_number:** a number representing the Wrye Bash version you want to check.  For example Wrye Bash version 284 could be intered as either __284__ or __"284"__.
* __Return:__
  * **-1:** Installed Wrye Bash version is less than the version specified in **version_number**.
  * **0:** Installed Wrye Bash version is the same as the version specified in **version_number**.
  * **1:** Installed Wrye Bash version is higher than the version specified in **version_number**.

== DataFileExists
Tests for the existance of a file in the Data directory.  If the file you are testing for is an ESP or ESM, this will also detected ghosted versions of the file.

* __Usage:__
  [codebox]DataFileExists(file_name [, ..., file_name_n])[/codebox]
* __Arguments:__
  * **file_name:** a string or variable holding a string, specifying the path relative to the Data directory to test.  For example using __"testesp.esp"__ would test for __"...path to oblivion...\Data\testesp.esp"__
* __Return:__
  * **True:** All of the files exist.
  * **False:** One or more of the files do not exist.

== GetEspmStatus
Tests the current status of an esp or espm in the Data directory.  This function takes esp/m ghosting into account when testing the status.

* __Usage:__
  [codebox]GetEspmStatus(file_name)[/codebox]
* __Arguments:__
  * **file_name:** a string or variable holding a string, specifying the path relative to the Data directory for the esp or esm to test.
* __Return:__
  * **-1:** The esp/m does not exist
  * ** 0:** The esp/m is not active, imported, or merged (<img src="bash/images/checkbox_green_off.png" width="16" height="16" style = 'border : 0' alt="Inactive"></img>)
  * ** 1:** The esp/m is not active, but has portions imported into the Bashed Patch (<img src="bash/images/checkbox_green_imp.png" width="16" height="16" style = 'border : 0' alt="Imported"></img>)
  * ** 2:** The esp/m is active (<img src="bash/images/checkbox_green_on.png" width="16" height="16" style = 'border : 0' alt="Active"></img>)
  * ** 3:** The esp/m is merged into the Bashed Patch (<img src="bash/images/checkbox_green_inc.png" width="16" height="16" style = 'border : 0' alt="Merged"></img>)

== EditINI
Tells Wrye Bash to create an ini tweak file with some tweaks in it.  If the file that you tell Wrye Bash to apply the tweak to is from the current installer or Oblivion.ini, then Wrye Bash will also automatically apply the tweak, otherwise, it will just be generated for the user to apply manually.

* __Usage:__
  [codebox]EditINI(file_name, section, setting, value [,comment])[/codebox]
* __Arguments:__
  * **file_name:** The name of the ini file you wish to edit, relative to the Data directory.
  * **section:** The section in the ini where **setting** resides, or 'set' or 'setGS' (see examples below)
  * **setting:** The setting you wish to change.
  * **value:** The value to set the setting to.
  * **comment:** Optional comment to include with this tweak.

* __Examples:__
  * **Setting an item in Oblivion.ini:**
  [codebox]EditINI('Oblivion.ini', 'General', 'bBorderRegionsEnabled', 0)[/codebox]
  .
  <pre>[General]
bBorderRegionsEnabled=0</pre>

  * **Setting an item in a script-like ini:**  Notice the use of **set** and **setGS** as the sections.
[codebox]
EditINI('TargetINI.ini', 'set', 'ANVars.UseEW', 1)
EditINI('TargetINI.ini', 'setGS', 'fPCBaseMagickaMult', 1)
[/codebox]
  .
  <pre>set ANVars.UseEW to 1
setGS fPCBaseMagickaMult 1</pre>

== Exec
This will cause the Wizard to execute lines that are passed to it.  This is usefull for creating dynamically generated menus.

* __Usage:__
  [codebox]Exec(lines)[/codebox]
* __Arguements:__
  * **lines:** A string containing lines to execute, seperated by newline characters, or a variable containing such a string.

* __Example:__
  . Would be the same as:
[codebox]
SelectOne 'Do you like icecream?', \
    '|Yes', 'Select this if you like icecream!', 'icecream.jpg', \
    'No', 'Select this if you do not like icecream', 'ihateicecream.jpg'
Case 'Yes'
    Note 'You like icecream!'
    Break
Case 'No'
    Note 'Why don\'t you like icecream?'
    Break
EndSelect
[/codebox]
  * Notice how the __\\\'__ was interpreted as __\'__ once the [color=purple]Exec[/color] was converted into lines.  Remember to add two extra backslashes so the final statement has a backslash in it!

== str
Used to convert a value into a string, for example when trying to concantenate a integer or decimal to a string.

* __Usage:__
  [codebox]str(value)[/codebox]
* __Arguments:__
  * **value:** any value.  An integer, decimal, variable, constant, or another string.
* __Return:__
  * String representation of **value**.  For example, __str(5)__ would return __"5"__.

== int
Used to convert a value to an integer, for example converting a value held in a string to a integer value.

* __Usage:__
  [codebox]int(value)[/codebox]
* __Arguments:__
  * **value:** any value.  An integer, decimal, variable, constant, or string.
* __Return:__
  * Integer value of **value**, if possible.  For example __int('65')__ would return __65__.
  * **0** if integer conversion is not possible.

== float
Used to convert a value to decimal, for example converting a value held in a string to a decimal value.

* __Usage:__
  [codebox]float(value)[/codebox]
* __Arguments:__
  * **value:** any value.  An integer, decimal, variable, constant, or string.
* __Return:__
  * Decimal value of **value**, if possible.  For example, __float('2.4')__ would return __2.4__.
  * **0.0** if decimal conversion is not possible.

== len
Used to find the length of a string.

* __Usage:__
  [codebox]len(string)[/codebox]
* __Arguments:__
  * **string:** a string, variable, or constant.
* __Return:__
  * Length of the string if possible.
  * **0** if length calculation was not possible.

== endswith
Test what a string ends with.

* __Usage:__
  [codebox]endswith(string, ending_1 [, ..., ending_n])[/codebox]
* __Arguments:__
  * **string:** a string, variable or constant.
  * **ending_1** through **ending_n:** a string, variable or constant.
* __Return:__
  * **True** if the string ends in ~~any~~ of the endings specified.
  * **False** if the string does not end in ~~any~~ of the endings specified.

== startswith
Test what a string starts with.

* __Usage:__
  [codebox]startswith(string, prefix_1 [, ..., prefix_n])[/codebox]
* __Arguments:__
  * **string:** a string, variable or constant.
  * **prefix_1** through **ending_n:** a string, variable or constant.
* __Return:__
  * **True** if the string begins with ~~any~~ of the prefixes specified.
  * **False** if the string does not begin with ~~any~~ of the prefixes specified.

== lower
Convert a string to lower case.

* __Usage:__
  [codebox]lower(string)[/codebox]
* __Arguments:__
  * **string:** a string or variable.
* __Return:__
  * **string** converted to lower case, or
  * The original **string** if an error occured.  For example if you tried to call __lower__ on a non-string type.

== find
Return index of first occurrance of a substring

* __Usage:__
  [codebox]find(string, substring [, start, stop])[/codebox]
* __Arguments:__
  * **string:** a string or variable to search in.
  * **substring:** a string or variable to search for.
  * **start:** Index at which to start searching in **string.** (Optional.  If not specified, searching will start at the beggining of **string**)
  * **stop:** Index at which to stop searching. (Optional.  If not specified, searching will stop at the end of **string**)
* __Return:__
  * The index of the first occurance of **substring** in **string**
  * **-1** if **substring** could not be found

== rfind
Return index of last occurrance of a substring

* __Usage:__
  [codebox]find(string, substring [, start, stop])[/codebox]
* __Arguments:__
  * **string:** a string or variable to search in.
  * **substring:** a string or variable to search for.
  * **start:** Index to start searching in **string.** (Optional.  If not specified, searching will start at the beggining of **string**)
  * **stop:** Index to start searching. (Optional.  If not specified, searching will stop at the end of **string**)
* __Return:__
  * The index of the last occurance of **substring** in **string**
  * **-1** if **substring** could not be found

== GetFilename
For a string that contains a path, returns the filename in that string.

* __Usage:__
  [codebox]GetFilename(path_string)[/codebox]
* __Arguments:__
  * **path_string:** a string or variable of the path to work with.
* __Return:__
  * The filename, or an empty string if there is not a file or if **path_string** is not a path.
* __Examples:__
[codebox]
GetFilename("C:\Program Files\Bethesda Softworks\Oblivion\Oblivion.exe") would return  "Oblivion.exe"
GetFilename("C:\Program Files\Bethesda Softworks\Oblivion") would return an empty string.
[/codebox]

== GetFolder
For a string that contains a path, returns the folder part of the string.

* __Usage:__
  [codebox]GetFolder(path_string)[/codebox]
* __Arguments:__
  * **path_string:** a string or variable of the path to work with.
* __Return:__
  * The folder, or an empty string if there is not one, or if **path_string** is not a path.
* __Examples:__
[codebox]
GetFolder("Data\mine.esp") would return "Data"
GetFolder("mine.esp") would return an empty string.
[/codebox]

= Keywords

Keywords are special identifiers that are used for controlling the flow of your wizard, or perform special tasks.  To use a keyword, place it on the beginning of a line, followed by any arguments to the keyword.  As of version 292: arguments must be separated by commas.

== SelectSubPackage
Cause the specified sub-package to be selected for installation.  This is equivilant to checking the sub-package and all the esps or esms in that subpackage in the BAIN window.

* __Usage:__
  [codebox]SelectSubPackage name[/codebox]
* __Arguments:__
  * **name:** string or variable holding the name of the sub-package to select.

== DeSelectSubPackage
Cause the specified sub-package to be de-selected from installation.  This is equivilant to un-checking the sub-package in the BAIN window.

* __Usage:__
  [codebox]DeSelectSubPackage name[/codebox]
* __Arguments:__
  * **name:** string or variable holding the name of the sub-package to de-select.

== SelectEspm
Cause the specified esp or esm to be selected for installation.  This is equivilant to checking the esp or esm from the BAIN window.

* __Usage:__
  [codebox]SelectEspm name[/codebox]
* __Arguments:__
  * **name:** string or variable holding the name of the esp or esm to select.

== DeSelectEspm
Cause the specified esp or esm to be deselected from installation.  This is equivilant to un-checking the esp or esm from the BAIN window.

* __Usage:__
  [codebox]DeSelectEspm name[/codebox]
* __Arguments:__
  * **name:** string or variable holding the name of the esp or esm to de-select.

== SelectAll
Cause all sub-packages, esps, and esms to be selected for installation.  This is equivilant to first checking all sub-packages in the BAIN window, then checking all esps and esms in the BAIN window.

* __Usage:__
  [codebox]SelectAll[/codebox]

== DeSelectAll
Cause all sub-packages, esps, and esms to be de-selected from installation.  This is equivilant to first un-checking all esps and esms in the BAIN window, then un-checking all sub-packages in the BAIN window.

* __Usage:__
  [codebox]DeSelectAll[/codebox]

== SelectAllEspms
Cause all esps and esms to be selected for installation.  This is equivilant to checking all esps and esms in the BAIN window

* __Usage:__
  [codebox]SelectAllEspms[/codebox]

== DeSelectAllEspms
Cause all esps and esms to be de-selected from installation.  This is equivilant to un-checking all esps and esms in the BAIN window.

* __Usage:__
  [codebox]DeSelectAllEspms[/codebox]

== RenameEspm
Change the installed name of an esp or esm.

* __Usage:__
  [codebox]RenameEspm original_name, new_name[/codebox]
* __Arguments:__
  * **original_name:** the name of the esp or esm, as it appears in the BAIN package.
  * **new_name:** the new name you want to have the esp or esm installed as.

== ResetEspmName
Resets the name of an esp or esm back to its default name.

* __Usage:__
  [codebox]ResetEspmName original_name[/codebox]
* __Arguments:__
  * **original_name:** the name of the esp or esm, as it appears in the BAIN package.

== ResetAllEspmNames
Resets the names of all the esps and esms back to their default names.

* __Usage:__
  [codebox]ResetAllEspmNames[/codebox]

== Note
Add a note to the user to be displayed at the end of the wizard, on the [[bash/images/finish.png|finish page]].  The '- ' will be added automatically.

* __Usage:__
  [codebox]Note note[/codebox]
* __Arguments:__
  * **note:** string, string variable, or expression that evalutates to a string, to be displayed on the [[bash/images/finish.png|finish page]].

== If-Elif-Else-EndIf
A basic __If__ control block.

__Usage:__
[codebox]
If statement
   lines
Elif statement
   lines
Elif statement 
   lines
Else
   lines
EndIf
[/codebox]

=== If
* A begins the control block.
* If **statement** evaluates to **True**, then the lines following it will be run, until the next __Elif__, __Else__, or __EndIf__.

=== Elif
* If **statement** evaluates to **True**, and the initial __If__ and none of the previous __Elif__'s were **True**, then the lines following this __Elif__ will be run, until the next __Elif__, __Else__, or __EndIf__.

=== Else
* If the initail __If__ and none of the previous __Elif__'s were **True**, then the lines following will be run until an __EndIf__ is met.

=== EndIf
* Signals the end of the __If__ control block.

== While-Continue-Break-EndWhile
A __While__ loop.

__Usage:__
[codebox]
While statement
    lines
    Continue
    lines
    Break
    lines
EndWhile
[/codebox]

=== While
* Begins the while loop.
* If **statement** evaluates to **True**, execution of the lines begins, otherwise execution skips to after the __EndWhile__.

=== Continue
* Signals the while loop to begin over again at the __While__ statement.

=== Break
* Signals the while loop to end execution, skipping to after the __EndWhile__.

=== EndWhile
* Ends the while loop.  **statement** is re-evaluated, and if **True**, execution begins again at the start of the __While__ block.

== For-Continue-Break-EndFor
A __For__ loop.  There are three possible For loops:
* __For__ **varname** from **start_value** to **end_value** [by **increment_value**]
  * **varname:** variable that will hold values.
  * **start_value:** Initial value of **varname**
  * **end_value:** value of **varname** that will end the for loop.
  * **increment_value:** Optional (defaults to ~~1~~ or ~~-1~~ as applicable).  This the value that will be added to **varname** at the end of each run of the loop.
* __For__ **varname** in Subpackages
  * **varname:** variable that will hold the SubPackage names.
  * This loop will iterate over the names of the SubPackages in the current installer.
* __For__ **varname** in **subpackage_name**
  * **varname:** variable that will hold the file names.
  * **subpackage_name:** SubPackage to list the files of.
  * This loop will iterate over each of the files contained in the SubPackage **subpackage_name**.  File names will be relative to the Data directory, before any remapping that would normally be done by BAIN.

* __Usage:__
[codebox]
For arguments
    lines
    Continue
    lines
    Break
    lines
EndFor

For sub in SubPackages
    For file in sub
        lines
    EndFor
EndFor
[/codebox]

=== For
* Begins the for loop.

=== Continue
* Signals the for loop to begin another iteration.

=== Break
* Signals the for loop to end execution, skipping to after the __EndFor__.

=== EndFor
* Ends the for loop.

== SelectOne
Shows a [[bash/images/selectone.jpg|dialog]] where the user can select one option from a list of options.  After the user presses the "Next" button, this begins a __Select__ control block.

* __Usage:__
[codebox]
SelectOne 'description', \
        'option 1', 'description 1', 'image 1', \
        'option 2', 'description 2', 'image 2', \
        ..., \
        'option n', 'description n', 'image n'
Case 'option 1'
    lines
    Break
Case 'option 2'
    lines
    Break
 ...
Case 'option n'
    lines
    Break
EndSelect
[/codebox]

* __Arguments:__
  * **description:** The text that will be displayed at the top of the dialog.  
  * **option n:** The text of the specific option. If the text begins with a "|", this is considered the default option and will be selected by default.
  * **description n:** The description to display when **option n** is selected.
  * **image n:** The image to display when **option n** is selected.  An empty string will make no image display.
  
=== Case
* The lines following the __Case__ will be run if the user selected **option n** on the dialog, until a __Break__ or __EndSelect__ is met.
* __Usage:__
  [codebox]Case option n[/codebox]

=== Default
* The lines following the __Default__ will be run, until a __Break__ or __EndSelect__,  if none of the __Case__ options have been run.
* __Usage:__
  [codebox]Default[/codebox]

=== Break
* Stops running lines in the current __Case__ or __Default__ block.
* __Usage:__
  [codebox]Break[/codebox]

=== EndSelect
* Signals the end of the __Select__ control block.
* __Usage:__
  [codebox]EndSelect[/codebox]

== SelectMany
Shows a [[bash/images/selectmany.jpg|dialog]] where the user can select multiple options from a list.  After the user presses the "Next" button, this begins a __Select__ control block.  See [[#SelectOne1|[color=blue]SelectOne[/color]]] for usage.

== Return
Signals completion of the wizard.  This will jump right to the [[bash/images/finish.png|finish page]].

* __Usage:__
  [codebox]Return[/codebox]

== Cancel
Cancels the wizard, with an optional text to display in a [[bash/images/cancel.jpg|dialog]] as to why the wizard was canceled.

* __Usage:__
  [codebox]Cancel [text][/codebox]

== RequireVersions
Tests the users system agains version requirements you specify.  If the requirements are not met, a [[bash/images/versions.jpg|warning dialog]] will be shown asking if you wish to continue anyway.

* __Usage:__
  [codebox]RequireVersions oblivion_version [, obse_version, obge_version, wrye_bash_version][/codebox]
* __Arguments:__
  * **oblivion_version:** Version of Oblivion to for.  See [[#CompareObVersion|CompareObVersion]] for the proper format of the string.
  * **obse_version:** Optional.  Version of OBSE to test for.  See [[#CompareOBSEVersion|CompareOBSEVersion]] for the proper format of the string.
  * **obge_version:** Optional.  Version of OBGE to test for.  See [[#CompareOBGEVersion|CompareOBGEVersion]] for the proper format of the string.
  * **wrye_bash_version:** Optional.  Version of Wrye Bash to test for.  See [[#CompareWBVersion|CompareWBVersion]] for more info.

= Operators

== Assignment Operators

Assignment operators are how you assign values to variables.  The usage can either be to assign one variable a value, or multiple variables the same value:
[codebox]
variable = value
variable1 = variable2 = variable3 = value
[/codebox]

=== Assignment (=)
[codebox]variable = value[/codebox]

=== Compound Assignment (+=, -=, etc)
There are compound assignment operators for all of the math operators.  A compound assignment will first perform the math operation using the variable and the value, then assign the result to the variable.
[codebox]
variable += value
variable -= value
variable *= value
[/codebox]

== Math Operators

=== Addition (+)
Adds two values, variables, etc together

=== Subtraction (-)
Subtracts two values, variables, etc.

=== Multiplication (*)
Multiplies two values, variables, etc together.

=== Division (/)
Divides two values, variables, etc.

=== Exponentiation (^)
Raised one value to the power of another value

==  Boolean Operators
Used to test the Truth of values

=== And (&amp;, and)
* __Usage:__
[codebox]
left & right
left and right
[/codebox]
* __Return:__
  * **True** if both **left** and **right** are **True**.
  * **False** otherwise.

=== Or (|, or)
* __Usage:__
[codebox]
left | right
left or right
[/codebox]
* __Return:__
  * **True** if either **left** or **right** is **True**.
  * **False** if neither **left** nor **right** is **True**.

=== Not (!, not)
* __Usage:__
[codebox]
!value
not value
[/codebox]
* __Return:__
  * **True** if value is **False**.
  * **False** if value is **True**.

=== In (in)
=== Case Insensitive In (in:)
* __Usage:__
[codebox]
left in right
left in: right
[/codebox]
* __Return:__
  * **True** if left is contained in right.  For example __'hi' in 'this'__ would return **True**.
  * **False** otherwise.

== Comparison Operators
Used to compare two values, variables, etc together.

=== Equal (==)
=== Case insensitive Equal (==:)
* __Usage:__
[codebox]
left == right
left ==: right
[/codebox]
* __Return:__
  * **True** if left is equal to right.
  * **False** otherwise.

=== Not Equal (!=)
=== Case insensitive Not Equal (!=:)
* __Usage:__
[codebox]
left != right
left !=: right
[/codebox]
* __Return:__
  * **True** if left does not equal right.
  * **False** otherwise.

=== Greater Than or Equal (&gt;=)
=== Case Insensitive Greater Than or Equal (&gt;=:)
* __Usage:__
[codebox]
left >= right
left >=: right
[/codebox]
* __Return:__
  * **True** if left is greater than or equal to right.
  * **False** otherwise.

=== Greater Than (&gt;)
=== Case Insensitive Greater Than (&gt;:)
* __Usage:__
[codebox]
left > right
left >: right
[/codebox]
* __Return:__
  * **True** if left is greater than right.
  * **False** otherwise.

=== Less Than or Equal (&lt;=)
=== Case Insensitive Less Than or Equal (&lt;=:)
* __Usage:__
[codebox]
left <= right
left <=: right
[/codebox]
* __Return:__
  * **True** if left is less than or equal to right.
  * **False** otherwise.

=== Less Than (&lt;)
=== Case Insensitive Less Than (&lt;:)
* __Usage:__
[codebox]
left < right
left <: right
[/codebox]
* __Return:__
  * **True** if left is less than right.
  * **False** otherwise

== Case Insensitive Operators
Some of the operators have case insensitive versions, which function the same as their normal versions, but when comparing strings, case is ignored.  The case insensitive versions end with a colon (:).  The following have case insensitive versions:

[codebox]
==:
!=:
>=:
>:
<=:
<:
in:
[/codebox]

== Dot Operator
Some functions can be accesed in an easier way, using the dot operator (.)  When accessed in this method, rather than specifying the first argument, the item to the left of the dot operator will be used.  The following functions can be called in this way:

[codebox]
len
endswith
startswith
lower
find
rfind
[/codebox]

== Indexing
Indexing is used to access specific parts of a sequence like item.  Currently, only strings and string variables can be indexed.  If you are familiar with Python's indexing syntax, then this will be familiar to you.

* __Usage:__
  * **string**[**start**:**stop**:**step**]
* __Arguments:__
  * **start:** index to start at.  If not specified, indexing will begin at index 0.
  * **stop:** index to stop at. If not specified, but the colon(:) is supplied, indexing will stop at the end of the string.  Otherwise, only one character will be indexed.
  * **step:** how to increment when indexing.  For example, a value of 2 would make the indexing return every second item.  If not specified, a value of 1 will be used.
  * Negative values for **start** and **stop** will be relative to the end of the sequence.  For example, -1 would mean the first character from the end of the sequence.

* __Examples:__
[codebox]
"Hello"[0]   returns "H"
"Hello"[0:]  returns "Hello"
"Hello"[:]   returns "Hello"
"Hello"[0:2] returns "He"
"Hello"[-1]  returns "o"
"Hello"[1:3] returns "el"
"Hello"[-2:] returns "lo"
[/codebox]  

= Built-in Constants
There are only a few constants that come defined in BAIN wizards.

=== True
* __Value:__ True (1)

=== False
* __Value: __ False (0)

= Escape Sequences
Escape sequences are special sequences of character you can put in a string to get a different character out when used in the wizard
* __'\t':__ Insert a Tab
* __'\n':__ Insert a newline character.

= Common Scripting Problems
Have a problem with your wizard script? Here are some common mistakes that cause errors or other strange behavior.
* Make sure the Case is right. Ex1: SelectSubPackage NOT SeLEctsUBPaCkaGe Ex2: Break NOT break
* Mismatched quotes. Ex: 'Plugin.esp" SHOULD BE 'Plugin.esp' or "Plugin.esp"
* Might be missing a , \ at the end of the line or one \ might need removed. This usually throws an error or not all options will be displayed.
* Extra spaces or tabs at the end of a line can cause problems with options showing up. Ex: "","",""\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* Missing called Image File.

= Examples for Beginners

==BAIN wizard Script Highlighter for NotePad++

<img src="bash/images/wizardscripthighlighter.jpg" alt="Notepad++ BAIN wizard Script Hightlighter in action" width="740" height="328" style='border: 0;'></img>

* It is recommended that you install utumno's <a href="http://www.tesnexus.com/downloads/file.php?id=32654">BAIN wizard Script Highlighter for Notepad plus plus</a> if you use Notepad++ to write your install scripts.
* It makes for spotting errors in your script a lot easier.

== BAIN Wizard Syntax for EmEditor
* broken85 created a similar Wizard highlighter for EmEditor. It can be found here: <a href="http://www.tesnexus.com/downloads/file.php?id=34240">BAIN Wizard Syntax for EmEditor</a>

== Create a Package Overview Readme
* Every Wizard should have some sort of nice little overview for the user to read before proceeding with the actual installation questions.
* Notice the following example has no Case's(This is intended) and the Default character is before the 'Start Here_Readme'.
[codebox]
SelectOne "Welcome to the ExampleMod's mod Setup Wizard", \
    "|Start Here_Readme", "If this is the first time you install this mod it's recommended that you carefully read the rest of the selections readme's to have an idea of what the optional parts of this mod do.", "", \
    "ExampleMod Overview", "ExampleText bla bla bla \n\nBla Bla Bla \n\n Bla Bla\n Bla", "", \
    "Changelog", "Example Fixes Release 1.01 \nExample Full Public 1.0 Release \nExample 2nd Beta Release 0.91 \n0.9 - Example Beta Release \n0.3 - Example Alpha Release \n0.01 - Example Initial Release", "", \
    "Guidelines for a Example install", "", "", \
    "ExampleMod Screenshots", "", "Screenshots\\ExampleScreenshot.jpg", \
    "Credits\\Authors", "Wrye - For BAIN. Woooooooot! \nLojack - For the wonderful BAIN wizard installer feature. \nMetallicow - For chewing the cud.", "", \
    "Language", "Language or Nationality this BAIN wizard was written in. \n\n English (USA)", "Wizard Images\\EnglishUSA.jpg"
EndSelect
[/codebox]

== Yes/No Question?
* Lets say that you want to ask the user a Yes or No question whether to install a feature of your mod.
* [[#SelectOne1|[color=blue]SelectOne[/color]]] in the following example could be replaced by many other [[#|Keywords]].
* [[#|[color=blue]SelectSubPackage[/color]]] in the following example could be replaced by many other [[#|Keywords]] or even another Yes/No Question Block.
[codebox]
SelectOne "Example: Yes/No Question?", \
      "Yes", "Description", "Wizard Images\\Yes.jpg", \
      "No", "Description", "Wizard Images\\No.jpg"
    Case "Yes"
        SelectSubPackage "00 Example Subpackage" ;;;Action/No Action
        Break
    Case "No"
        ;No Plugin ;;Action/No Action
        Break
EndSelect
[/codebox]

== Check for a Plugin
* Lets say that you want to check the users data folder for a specific plugin, to check if a patch (you might have created) should apply.
[codebox]
If DataFileExists("ExamplePlugin.esp")
    Note "ExamplePlugin Detected." ;;;Action/No Action
    SelectEspm "PatchPlugin.esp"   ;;;Action/No Action
Else ; ExamplePlugin.esp wasn't detected
    ;No Plugin                     ;;;Action/No Action
EndIf
[/codebox]

== Use SVN features safely
* You're spruicing up your wizard with some fancy new features that are only availible in the SVN.  How will you make sure that your wizard still works for people with the official release?
* Enclose the 'SVN only' code in a version check.
[codebox]
If CompareWBVersion('292') >= 0
    ; User is running 292+
    ; Do some 292+ only stuff here, like...
    EditINI('Oblivion.ini', 'Display', 'bAllowScreenShot', 1)
Else
    ; User is running &lt; 292, so EditINI is unavailable.
    Note "Don't forget to enable screenshots in Oblivion.ini"
EndIf
[/codebox]

== Mods with Wizards
* This is a list of some mods that have wizards included with them if you would like to look at them for reference.
  * <a href="http://www.tesnexus.com/downloads/file.php?id=19628">Animated Window Lighting System and Chimneys - AWLS</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=31062">Bain Conversion Files</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=16513">Bananasplit Better Cities</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=36005">Fast and Easy Frans WIZBAIN Archive Maker -ENGLISH ONLY-</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=35856">Metallicow Cursor Mod</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=19370">Unique Landscapes Compilation</a>,  <a href="http://www.tesnexus.com/downloads/file.php?id=18305">Weather - All Natural</a>

</td></tr></table>
= Wizard to OBMM Script Comparison
<table style="width:100%;"><tr valign="top"><td style="border: 1px solid #000000; padding: 5px; background: #f6f68c; width:100%;">
This is a comparison of OBMM's OMOD scripting language to BAIN's Wizards.
== Functionality with direct correlation to OBMM Script
<table style="width:100%;"><tr valign="top"><td style="border: 1px; padding:5px background: #F6F68C; width:50%;">
OBMM
</td><td style="border: 1px; padding:5px; background: #F6F68C; width:50%;">
Wizards
</td></tr>
<tr><td class="code">
===If [color=blue]&lt;function&gt;[/color] [...]
__IfNot [color=blue]&lt;function&gt;[/color] [...]__
</td>
<td class="code">[code]
If statement
If not statement
[/code]</td></tr>
<tr><td class="code">
<br />
===Else
===EndIf
</td>
<td class="code">[code]
Elif
Else
EndIf
[/code]</td></tr>
<tr><td class="code">
===If DialogYesNo [color=blue]&lt;Message&gt;[/color] [color=brown][Title][/color]
</td>
<td class="code">[code]
SelectOne message, "Yes", yes_description, yes_image, "No", no_description, no_image
Case "Yes"
    statements
    Break
Case "NO"
    statements
    Break
EndSelect
[/code]</td></tr>
<tr><td class="code">
===If DataFileExists [color=blue]&lt;FileName&gt;[/color]
</td><td class="code">[code]
If DataFileExists(filename)
[/code]</td></tr>
<tr><td class="code">
===If ScriptExtenderPresent
</td><td class="code">[code]
If CompareOBSEVersion("0.0.0.0") == 1
[/code]</td></tr>
<tr><td class="code">
===If ScriptExtenderNewerThan [color=blue]&lt;version&gt;[/color]
</td><td class="code">[code]
If CompareOBSEVersion(version) == 1
[/code]</td></tr>
<tr><td class="code">
===If GraphicsExtenderPresent
</td><td class="code">[code]
If CompareOBGEVersion("0.0.0.0") == 1
[/code]</td></tr>
<tr><td class="code">
===If GraphicsExtenderNewerThan
</td><td class="code">[code]
If CompareOBGEVersion(version) == 1
[/code]</td></tr>
<tr><td class="code">
===If OblivionNewerThan [color=blue]&lt;version&gt;[/color]
</td><td class="code">[code]
If CompareObVersion(version) == 1
[/code]</td></tr>
<tr><td class="code">
===If Equal [color=blue]&lt;arg1&gt;[/color] [color=green]&lt;arg2&gt;[/color]
__If GreaterThan [color=blue]&lt;arg1&gt;[/color] [color=green]&lt;arg2&gt;[/color]__
__If GreaterEqual [color=blue]&lt;arg1&gt;[/color] [color=green]&lt;arg2&gt;[/color]__
__If fGreaterThan [color=blue]&lt;arg1&gt;[/color] [color=green]&lt;arg2&gt;[/color]__
__If fGreaterEqual [color=blue]&lt;arg1&gt;[/color] [color=green]&lt;arg2&gt;[/color]__
</td><td class="code">[code]
If statement == statement
If statement >  statement
If statement >= statement
If statement >  statement
If statement >= statement
[/code]</td></tr>
<tr><td class="code">
===Select [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=purple][Option2][/color] [...]
__SelectWithPreview [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=brown]&lt;ImagePath1&gt;[/color] [color=purple][Option2][/color] [color=blue][ImagePath2][/color] [...]__
__SelectWithDescriptions [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=orange]&lt;Description1&gt;[/color] [color=purple][Option2][/color] [color=orange][Description2][/color] [...]__
__SelectWithDescriptionsAndPreviews [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=brown]&lt;ImagePath1&gt;[/color] [color=orange]&lt;Description1&gt;[/color] [color=purple][Option2][/color] [color=blue][ImagePath2][/color] [color=orange][Description2][/color] [...]__
</td><td class="code">[code]
SelectOne title, option1, description1, image1, option2, description2, image2 [...]
[/code]</td></tr>
<tr><td class="code">
===SelectMany [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=purple][Option2][/color] [...]
__SelectManyWithPreview [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=brown]&lt;ImagePath1&gt;[/color] [color=purple][Option2][/color] [color=blue][ImagePath2][/color] [...]__
__SelectManyWithDescriptions [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=orange]&lt;Description1&gt;[/color] [color=purple][Option2][/color] [color=orange][Description2][/color] [...]__
__SelectManyWithDescriptionsAndPreviews [color=blue]&lt;Title&gt;[/color] [color=green]&lt;Option1&gt;[/color] [color=brown]&lt;ImagePath1&gt;[/color] [color=orange]&lt;Description1&gt;[/color] [color=purple][Option2][/color] [color=blue][ImagePath2][/color] [color=orange][Description2][/color] [...]__
</td><td class="code">[code]
SelectMany title, option1, description1, image1 [...]
[/code]</td></tr>
<tr><td class="code">
===Case &lt;option&gt;
===Default
===Break
===EndSelect
</td><td class="code">[code]
Case option
Default
Break
EndSelect
[/code]</td></tr>
<tr><td class="code">
===For Count [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;Start&gt;[/color] [color=blue]&lt;End&gt;[/color] [color=orange][Step][/color]
__Continue__
__Exit__
__EndFor__
</td><td class="code">[code]
For variable from start to end by step
Continue
Break
EndFor
[/code]</td></tr>
<tr><td class="code">
===Return
</td><td class="code">[code]
Return
[/code]</td></tr>
<tr><td class="code">
__DontInstallPlugin [color=blue]&lt;Plugin&gt;[/color]__
===InstallPlugin [color=blue]&lt;Plugin&gt;[/color]
</td><td class="code">[code]
DeSelectEspm plugin
SelectEspm plugin
[/code]</td></tr>
<tr><td class="code">
===CopyPlugin [color=blue]&lt;CopyFrom&gt;[/color] [color=purple]&lt;CopyTo&gt;[/color]
</td><td class="code">[code]
RenameEspm original_name new_name
[/code]</td></tr>
<tr><td class="code">
===EditINI [color=blue]&lt;section&gt;[/color] [color=purple]&lt;key&gt;[/color] [color=green]&lt;value&gt;[/color]
</td><td class="code">[code]
EditINI("Oblivion.ini", section, setting, value)
[/code]</td></tr>
<tr><td class="code">
===FatalError
</td><td class="code">[code]
Cancel [message]
[/code]</td></tr>
<tr><td class="code">
===SetVar [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;Value&gt;[/color]
</td><td class="code">[code]
variable = value
[/code]</td></tr>
<tr><td class="code">
===StringLength [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;String&gt;[/color]
</td><td class="code">[code]
variable = len(string)
variable = string.len()
[/code]</td></tr>
<tr><td class="code">
===iSet [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;expression&gt;[/color]
__fSet [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;expression&gt;[/color]__
</td><td class="code">[code]
variable = expression
[/code]</td></tr>
<tr><td class="code">
===ExecLines [color=blue]&lt;lines&gt;[/color]
</td><td class="code">[code]
Exec(lines)
[/code]</td></tr>
<tr><td class="code">
===SubString [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;String&gt;[/color] [color=blue]&lt;startfrom&gt;[/color] [color=brown][length][/color]
</td><td class="code">[code]
find(variable, string, start, stop)
variable.find(string, start, stop)
[/code]</td></tr>
</table>
== Functions in OBMM that do not have a direct equivalent, but a similar effect can be achieved in Wizards
<table style="width:100%;"><tr valign="top"><td style="border: 1px; padding:5px background: #F6F68C; width:50%;">
OBMM
</td><td style="border: 1px; padding:5px; background: #F6F68C; width:50%;">
Wizards
</td></tr>
<tr><td class="code">
===Message [color=blue]&lt;Message&gt;[/color] [color=brown][Title][/color]
===DisplayImage [color=blue]&lt;Image File Path&gt;[/color] [color=brown][Title][/color]
===DisplayText [color=blue]&lt;Text File Path&gt;[/color] [color=brown][Title][/color]
</td><td class="code">
<p>Similar functionality can be reproduced using [code]Note[/code] and [code]SelectOne[/code] or [code]SelectMany[/code] keywords.</p>
</td></tr>
<tr><td class="code">
===ConflictWith [color=blue]&lt;ModName&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===DependsOn [color=blue]&lt;ModName&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
</td><td class="code">
Similar functionality can be reproduced using [code]If DataFileExists(modname)[/code]
</td></tr>
<tr><td class="code">
===DontInstallDataFile [color=blue]&lt;FileName&gt;[/color]
===InstallDataFile [color=blue]&lt;FileName&gt;[/color]
===DontInstallDataFolder [color=blue]&lt;FolderName&gt;[/color] [color=brown][RecurseSubfolders][/color]
===InstallDataFolder [color=blue]&lt;FolderName&gt;[/color] [color=brown][RecurseSubfolders][/color]
===CopyDataFile [color=blue]&lt;CopyFrom&gt;[/color] [color=purple]&lt;CopyTo&gt;[/color]
===CopyDataFolder [color=blue]&lt;CopyFrom&gt;[/color] [color=purple]&lt;CopyTo&gt;[/color] [color=brown][RecurseSubfolders][/color]
</td><td class="code">
Similar functionality can be obtained by packaging the mod differently, and then using [code]SelectSubPackage[/code] and [code]DeSelectSubPackage[/code]
</td></tr>
<tr><td class="code">
===For Each DataFolder [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;FolderPath&gt;[/color] [color=brown][RecurseSubFolders][/color] [color=orange][SearchString][/color]
===For Each DataFile [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;FolderPath&gt;[/color] [color=brown][RecurseSubFolders][/color] [color=orange][SearchString][/color]
===For Each PluginFolder [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;FolderPath&gt;[/color] [color=brown][RecurseSubFolders][/color] [color=orange][SearchString][/color]
===For Each Plugin [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;FolderPath&gt;[/color] [color=brown][RecurseSubFolders][/color] [color=orange][SearchString][/color]
</td><td class="code">
Use:
[code]  For subpackage in SubPackages[/code]
and/or:
[code]  For file in subpackage[/code]
to iterate over files and folders in an installer.  Then use:
[code]
  file.lower().endswith(".esp")
  GetFilename(file)
  GetFolder(file)
[/code]
and other string manipulation functions to test file names and folders.
</td></tr></table>

== Functions in OBMM that do not have an equivalent in Wizards
<table style="width:100%;"><tr valign="top">
<td class="code">
===SelectVar [color=green]&lt;Variable&gt;[/color]
===SelectString [color=green]&lt;Variable&gt;[/color]
===Goto [color=blue]&lt;label&gt;[/color]
===Label [color=blue]&lt;label&gt;[/color]
===LoadBefore [color=blue]&lt;Plugin1&gt;[/color] [color=purple]&lt;Plugin2&gt;[/color]
===LoadAfter [color=blue]&lt;Plugin1&gt;[/color] [color=purple]&lt;Plugin2&gt;[/color]
  . Use BOSS in Wrye Bash instead.
===UncheckESP [color=blue]&lt;plugin&gt;[/color]
===SetDeactivationWarning [color=blue]&lt;plugin&gt;[/color] [color=purple]&lt;warning&gt;[/color]
===ConflictsWith [color=blue]&lt;ModName&gt;[/color] [color=green]&lt;MinMajorVersion&gt;[/color] [color=brown]&lt;MinMinorVersion&gt;[/color][color=blue]&lt;MaxMajorVersion&gt;[/color] [color=green]&lt;MaxMinorVersion&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===ConflictsWithRegex [color=blue]&lt;ModName&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===ConflictsWithRegex [color=blue]&lt;ModName&gt;[/color] [color=green]&lt;MinMajorVersion&gt;[/color] [color=brown]&lt;MinMinorVersion&gt;[/color][color=blue]&lt;MaxMajorVersion&gt;[/color] [color=green]&lt;MaxMinorVersion&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===DependsOn [color=blue]&lt;ModName&gt;[/color] [color=green]&lt;MinMajorVersion&gt;[/color] [color=brown]&lt;MinMinorVersion&gt;[/color][color=blue]&lt;MaxMajorVersion&gt;[/color] [color=green]&lt;MaxMinorVersion&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===DependsOnRegex [color=blue]&lt;ModName&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===DependsOnRegex [color=blue]&lt;ModName&gt;[/color] [color=green]&lt;MinMajorVersion&gt;[/color] [color=brown]&lt;MinMinorVersion&gt;[/color][color=blue]&lt;MaxMajorVersion&gt;[/color] [color=green]&lt;MaxMinorVersion&gt;[/color] [color=purple][Comment][/color] [color=orange][Level][/color]
===RegisterBSA [color=blue]&lt;FileName&gt;[/color]
===UnregisterBSA [color=blue]&lt;FileName&gt;[/color]
===EditShader [color=blue]&lt;ShaderPackage&gt;[/color] [color=purple]&lt;ShaderName&gt;[/color] [color=green]&lt;BinaryObjectPath&gt;[/color]
===SetGMST [color=blue]&lt;file&gt;[/color] [color=purple]&lt;Editor ID&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetGlobal [color=blue]&lt;file&gt;[/color] [color=purple]&lt;Editor ID&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetPluginByte [color=blue]&lt;file&gt;[/color] [color=purple]&lt;offset&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetPluginByte [color=blue]&lt;file&gt;[/color] [color=purple]&lt;offset&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetPluginShort [color=blue]&lt;file&gt;[/color] [color=purple]&lt;offset&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetPluginLong [color=blue]&lt;file&gt;[/color] [color=purple]&lt;offset&gt;[/color] [color=green]&lt;new value&gt;[/color]
===SetPluginFloat [color=blue]&lt;file&gt;[/color] [color=purple]&lt;offset&gt;[/color] [color=green]&lt;new value&gt;[/color]
===GetFolderName [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;path&gt;[/color]
===GetFileName [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;path&gt;[/color]
===GetFileNameWithoutExtension [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;path&gt;[/color]
===CombinePaths [color=gree]&lt;Variable&gt;[/color] [color=purple]&lt;path1&gt;[/color] [color=blue]&lt;path2&gt;[/color]
===RemoveString [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;String&gt;[/color] [color=blue]&lt;startfrom&gt;[/color] [color=brown][length][/color]
===InputString [color=green]&lt;Variable&gt;[/color] [color=brown][Title][/color] [color=purple][Initial][/color]
===ReadINI [color=green]&lt;Variable&gt;[/color] [color=blue]&lt;section&gt;[/color] [color=purple]&lt;value&gt;[/color]
===ReadRenderInfo [color=green]&lt;Variable&gt;[/color] [color=purple]&lt;value&gt;[/color]
===EditXMLLine [color=blue]&lt;file&gt;[/color] [color=purple]&lt;line number&gt;[/color] [color=green]&lt;new line&gt;[/color]
===EditXMLReplace [color=blue]&lt;file&gt;[/color] [color=purple]&lt;text to find&gt;[/color] [color=green]&lt;text to replace&gt;[/color]
</td></tr>
</table>

== Functions in Wizards that do not have an equivalent in OBMM
<table style="width:100%;"><tr valign="top">
<td class="code">[code]
CompareWBVersion(version)
GetEspmStatus(plugin)
str(value)
int(value)
float(value)
SelectAll
DeSelectAll
SelectAllEspms
DeSelectAllEspms
While expression
    Continue
    Break
EndWhile[/code]
. Similar loops can be made using Label/Goto and If statements in OBMM.
[code]RequireVersions oblivion, obse, obge, wrye_bash[/code]
</td></tr>
</table>

== Functions that have no meaning in Wrye Bash
<table style="width:100%;"><tr valign="top">
<td class="code">
===If VersionGreaterThan [color=blue]&lt;version&gt;[/color]
===If VersionLessThan [color=blue]&lt;version&gt;[/color]
  . Use [code]CompareWBVersion[/code] to check the Wrye Bash version.
===PatchDataFile [color=blue]&lt;NewFile&gt;[/color] [color=purple]&lt;FileToPatch&gt;[/color] [color=brown][Create][/color]
===PatchPlugin [color=blue]&lt;NewFile&gt;[/color] [color=purple]&lt;FileToPatch&gt;[/color] [color=brown][Create][/color]
  . Unnecessary due to BAIN's conflict resolution of data files.
===AllowRunOnLines
  . Runon lines have always been supported in Wizards.
</td></tr>
</table>

</td></tr></table>
