mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
1d4a3c700b
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@985 0fc631ac-6414-0410-93d0-97cfa31319b6
55 lines
2.5 KiB
Plaintext
55 lines
2.5 KiB
Plaintext
Scripting language
|
|
|
|
MSE uses a custom scripting language to add complicated behaviour to [[type:field]]s and [[type:style]]s.
|
|
|
|
--Topics--
|
|
* [[script:introduction|Introduction to scripting]]
|
|
* [[script:Operators]]
|
|
* [[script:variables|Variables]]
|
|
* [[script:functions|Functions]]
|
|
* [[script:default_arguments|Default arguments]]
|
|
* [[script:Control structures]]
|
|
* [[script:Predefined variables]]
|
|
* [[script:Best practices]]
|
|
See also:
|
|
* [[type:index|Data types used]]
|
|
* [[fun:index|Built in functions]]
|
|
|
|
--Syntax index--
|
|
| @123@ [[type:int|A literal number]]
|
|
| @"stuff"@ [[type:string|A literal string]]
|
|
| @[a,b,c]@ [[type:list|A literal list]]
|
|
| @[a:b, c:d]@ [[type:map|A literal map]]
|
|
| @{ expr }@ [[script:functions|Function definition]]
|
|
| @fun(a:b, c:d)@ [[script:functions|Function call]]
|
|
| @fun(value)@ [[script:functions|Function call with '@input@' argument]]
|
|
| @fun@@(a:b)@ [[script:default_arguments|Default arguments]]
|
|
| @a.b@ [[script:operators|Property 'b' of 'a']]
|
|
| @a[b]@ [[script:operators|Property 'value of b' of 'a']]
|
|
| @-a@ [[script:operators|Negation]]
|
|
| @a + b@ [[script:operators|Addition / concatenation]]
|
|
| @a - b@ [[script:operators|Subtraction]]
|
|
| @a * b@ [[script:operators|Multiplication]]
|
|
| @a / b@ [[script:operators|Floating point division]]
|
|
| @a div b@ [[script:operators|Integer division]]
|
|
| @a mod b@ [[script:operators|Remainder]]
|
|
| @not a@ [[type:boolean|Boolean not]]
|
|
| @a and b@ [[type:boolean|Boolean conjunction]]
|
|
| @a or b@ [[type:boolean|Boolean disjunction]]
|
|
| @a xor b@ [[type:boolean|Boolean xor]]
|
|
| @a == b@ [[script:operators|Comparison for equality]]
|
|
| @a != b@ [[script:operators|Comparison for inequality]]
|
|
| @a < b@ [[script:operators|Comparison]]
|
|
| @a > b@ [[script:operators|Comparison]]
|
|
| @a <= b@ [[script:operators|Comparison]]
|
|
| @a >= b@ [[script:operators|Comparison]]
|
|
| @a or else b@ Use @a@ unless it is an error, then use @b@ instead.
|
|
| @min(a,b,c,...)@ [[script:operators|Smallest of the values]]
|
|
| @max(a,b,c,...)@ [[script:operators|Largest of the values]]
|
|
| @rgb(r,g,b)@ [[type:color|A color value]]
|
|
| @rgba(r,g,b)@ [[type:color|A color value with transparency]]
|
|
| @if x then y@ [[script:control structures|Conditional expresion]]
|
|
| @if x then y else z@ [[script:control structures|Conditional expresion]]
|
|
| @for x in list do y@ [[script:control structures|Loop over elements in a list]]
|
|
| @for x from a to b do y@ [[script:control structures|Loop over numbers from a to b]]
|