diff --git a/Mopy/Docs/Wrye Bash Technical Readme.html b/Mopy/Docs/Wrye Bash Technical Readme.html index a06ba9f6c4..d04bdafebb 100644 --- a/Mopy/Docs/Wrye Bash Technical Readme.html +++ b/Mopy/Docs/Wrye Bash Technical Readme.html @@ -170,7 +170,7 @@
CompareGEVersion - Used to test the installed version of the Graphics Extender of the game that Wrye Bash is running for against the one you specify.
CompareGEVersion(version_string)
"0.0.20.1"
.
+ "3.0.1"
.
Return values:
CompareWBVersion - Used to test the installed version of Wrye Bash against the one you specify.
CompareWBVersion(version_string)
"0.0.20.1"
.
+ "307"
.
Return values:
2
- The esp/m is active. Its checkbox in Wrye Bash's Mods tab is .
3
- The esp/m is merged into the Bashed Patch. Its checkbox in Wrye Bash's Mods tab is .
DisableINILine - Tells Wrye Bash to create an ini tweak file that disables the specified setting by commenting it out. Otherwise, behaves identically to EditINI.
+DisableINILine(file_name, section, setting)
+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 is the game's ini file, then Wrye Bash will also automatically apply the tweak, otherwise, it will just be generated for the user to apply manually.
-EditINI(file_name, section, setting, value [,comment])
+EditINI(file_name, section, setting, value [, comment])
Exec - This will cause the Wizard to execute lines that are passed to it. This is useful for creating dynamically generated menus.
Exec(lines)
\'
should be written \\\'
.
EndExec - Internal function used to mark the end of the lines executed by an Exec statement. Attempting to explicitly call it will result in an error.
+EndExec(line_count)
+str - Used to convert a value into a string, for example when trying to concantenate a integer or decimal to a string.
str(value)
Note: For any of these operators, you can mix decimals and integers. In such a case, the integer will simply be promoted to a decimal, and the result will be a decimal as well.
+Addition: +
. Adds one integer or decimal to another, or concatenates two strings.
+1 + 1 ; == 2
+1 + 1.0 ; == 2.0
+1.0 + 1 ; == 2.0
+1.0 + 1.0 ; == 2.0
+"foo" + "bar" ; == "foobar"
+
Subtraction: -
. Substracts one integer or decimal from another.
+1 - 1 ; == 0
+1 - 1.0 ; == 0.0
+1.0 - 1 ; == 0.0
+1.0 - 1.0 ; == 0.0
+
Multiplication: *
. Multiplies one integer or decimal with another, or copies a string multiple times (see example).
+1 * 1 ; == 1
+1 * 1.0 ; == 1.0
+1.0 * 1 ; == 1.0
+1.0 * 1.0 ; == 1.0
+; Multiplying a string by
+; an integer just concatenates
+; several copies of it:
+"foo" * 2 ; == "foofoo"
+3 * "h" ; == "hhh"
+; Note: the other type _must_
+; be an integer, decimals
+; are not allowed:
+2.0 * "a" ; error
+
Division: /
. Divides one integer or decimal by another. Division by zero causes an error.
+1 / 1 ; == 1
+1 / 1.0 ; == 1.0
+1.0 / 1 ; == 1.0
+1.0 / 1.0 ; == 1.0
+1 / 0 ; error
+1.0 / 0.0 ; error
+
Exponentiation: ^
. Raises one integer or decimal to the power of another.
+2 ^ 2 ; == 4
+2 ^ 2.0 ; == 4.0
+2.0 ^ 2 ; == 4.0
+2.0 ^ 2.0 ; == 4.0
Assignment operators are used to assign values to variables. Compound assignment operators are a combination of assignment operator and mathematical operator, performing the operation and assigning it to a variable in one step.
Assignment: =
-variable = value
+test = 3 ; test now has value 3
+foo = "bar" ; foo now has value "bar"
Compound Assignment: +=
, -=
, *=
, /=
, ^=
-variable += value
-variable -= value
-variable *= value
-variable /= value
-variable ^= value
-
-
Mathematical operators allow you to add, subtract, multiply, divide and exponentiate integers and decimals. The addition and multiplication operators can also be used on strings. -
Addition: +
-var1 + var2
-
Subtraction: -
-var1 - var2
-
Multiplication: *
-var1 * var2
-
Division: /
-var1 / var2
-
Exponentiation: ^
.
-var1 ^ var2
+
var += expr
): Assigns the result of var + expr
to var. In other words, this is equivalent to var = var + expr
. May also be used to concatenate two strings, just like +
.var -= expr
): Assigns the result of var - expr
to var. In other words, this is equivalent to var = var - expr
.var *= expr
): Assigns the result of var * expr
to var. In other words, this is equivalent to var = var * expr
. May also be used to repeat a string using an integer, just like *
.var /= expr
): Assigns the result of var / expr
to var. In other words, this is equivalent to var = var / expr
.var ^= expr
): Assigns the result of var ^ expr
to var. In other words, this is equivalent to var = var ^ expr
.These operators increase or decrease a variable containing an integer or decimal by 1 and then return the changed value. They can be placed them before or after the variable that should be changed.
+Warning: If you are familiar with other programming languages, you may expect ++var
and var++
to behave differently. However, in wizards they both behave the same way, returning the new value (var + 1
) in both cases. In other words, wizards only support pre-increment and pre-decrement operators.
++
. Increases a variable by 1
and returns the new value.
+ foo = 1 ; foo == 1
+bar = foo++ ; foo == 2, bar == 2
+++bar ; foo == 2, bar == 3
--
. Decreases a variable by 1
and returns the new value.
+ foo = 3 ; foo == 3
+bar = foo-- ; foo == 2, bar == 2
+--bar ; foo == 2, bar == 1
Boolean operators can be used to test the logical truth of values.
And: &
, and
. Returns True
if both sides of the expression are true and False
otherwise.
@@ -585,7 +639,9 @@
!value
not value
In: in
. Returns True
if the left hand side of the expression is contained in the right hand side, and False
otherwise.
-var1 in var2
+If value in SubPackages
+ ; do something here
+EndIf
Comparison operators are used to compare two values or variables with one another.
Equal: ==
. Returns True
if the left hand side of the expression is equal to the right hand side of the expression, and False
otherwise.
@@ -612,8 +668,10 @@
in:
The dot operator can be used to call a function on a variable without having to specify the variable in the function's arguments. This functionality will be familiar to anyone with experience in Object-Orientated programming. The syntax is:
-variable.function
+
The dot operator can be used to call a function on a variable without having to specify the variable in the function's arguments. This functionality will be familiar to anyone with experience in object-oriented programming:
+; These two are equivalent
+myStr.startswith("foo")
+startswith(myStr, "foo")
The following functions can be used with the dot operator:
len
@@ -623,30 +681,37 @@ find
rfind
Indexing is used to access a specific location in a sequence. Currently only strings and string variables can be indexed. The syntax used is similar to Python's indexing syntax. +
Indexing is used to access a specific location in a sequence. Slicing is an extension of indexing that returns a part of the sequence. Currently only strings and string variables can be indexed / sliced. The syntax used is identical to Python's syntax.
+Indexing:
+string[index]
+Slicing:
string[start:stop:step]
-Arguments:
:
is supplied, indexing will continue to the end of the sequence. If not specified and no colon is supplied, only one character will be indexed.
- 2
would return every second item in the sequence. 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:
-"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"
+
:
is supplied, indexing will continue to the end of the sequence. If not specified and no colon is supplied, only one character will be indexed.2
would return every second item in the sequence. If not specified, a value of 1
will be used.
Negative values for index, 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:
+"Hello"[0] ; returns "H"
+"Hello"[2] ; returns "l"
+"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"
Only two constants are defined in BAIN Wizards. -
True - True
. Equal to boolean true
(text representation) or 1
(binary representation).
-
False - False
. Equal to boolean false
(text representation) or 0
(binary representation).
+
Only three constants are defined in BAIN Wizards: +
True - True
. Equal to boolean true
(text representation) or 1
(binary representation).
False - False
. Equal to boolean false
(text representation) or 0
(binary representation).
SubPackages - A list of strings. Contains the names of the subpackages of the installer that this wizard belongs to. Can be iterated over with a For
statement or used with the in
operator.
Escape sequences are special sequences of characters you can use to get a different character outputted. The escape sequences allowed are: @@ -900,6 +965,7 @@
CompareWBVersion(version)
GetEspmStatus(plugin)
+DisableINILine(file_name, section, setting)
str(value)
int(value)
float(value)