diff --git a/README.md b/README.md index 2921e11..7519316 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,14 @@ execute if std:out run return run function my_function ``` # Functions +> [!Note] +> The functions under the `z_:` namespace are used internally by mcfstd and are not meant to be called directly unless you know what you are doing. + - @@ -81,7 +83,6 @@ execute if std:out run return run function my_function - @@ -91,14 +92,12 @@ execute if std:out run return run function my_function - - @@ -108,21 +107,18 @@ execute if std:out run return run function my_function - - - @@ -132,50 +128,45 @@ execute if std:out run return run function my_function - - + - - + - - + - - + - - + @@ -184,51 +175,46 @@ execute if std:out run return run function my_function - - + - + - - + - + - - + - + - - + - + - - + - + @@ -237,7 +223,6 @@ execute if std:out run return run function my_function - - +
Function Arguments DescriptionExample
Variablesvar:set k Name of the variable (string) Set the value of a variablefunction var:set { k: my_variable, v: 10 }
v Value of the variable (int)var:unset k Name of the variable (string) Remove a varialbefunction var:unset { k: my_variable }
var:mv k Old variable name (string) Rename a variablefunction var:mv { k: my_variable, v: my_renamed_variable }
v New variable name (string)var:inc k Name of the variable (string) Increment the value of a variablefunction var:inc { k: my_variable }
var:dec k Name of the variable (string) Decrement the value of a variablefunction var:dec { k: my_variable }
var:put - Put the current value of A into this variablefunction var:put { k: my_variable }
Arithmeticmath:add k Name of the variable (string) Add a number to the current value of a variable and store the result in Afunction math:add { k: my_variable, v: 10 }
v Number to add (string)v Number to add (int)
math:sub k Name of the variable (string) Subtract a number to the current value of a variable and store the result in Afunction math:sub { k: my_variable, v: 10 }
v Number to subtract (string)v Number to subtract (int)
math:mul k Name of the variable (string) Multiply a number with the current value of a variable and store the result in Afunction math:mul { k: my_variable, v: 10 }
v Number to multiply (string)v Number to multiply (int)
math:div k Name of the variable (string) Divide a number with the current value of a variable and store the result in Afunction math:div { k: my_variable, v: 10 }
v Number to divide (string)v Number to divide (int)
math:mod k Name of the variable (string) Modulo a number with the current value of a variable and store the result in Afunction math:mod { k: my_variable, v: 10 }
v Number to modulo (string)v Number to modulo (int)
Relation / Compare
comp:eq a Name of the first variable (string)Check if a = b and store the result in stdoutfunction comp:eq { a: my_variable, b: my_other_variable }Check if a = b and store the result in the standard output
v Name of the second variable (string)b Name of the second variable (string)
comp:gt a Name of the first variable (string)Check if a > b and store the result in stdoutfunction comp:gt { a: my_variable, b: my_other_variable }Check if a > b and store the result in the standard output
v Name of the second variable (string)b Name of the second variable (string)
comp:gteq a Name of the first variable (string)Check if a >= b and store the result in stdoutfunction comp:gteq { a: my_variable, b: my_other_variable }Check if a >= b and store the result in the standard output
v Name of the second variable (string)b Name of the second variable (string)
comp:lt a Name of the first variable (string)Check if a < b and store the result in stdoutfunction comp:lt { a: my_variable, b: my_other_variable }Check if a < b and store the result in the standard output
v Name of the second variable (string)b Name of the second variable (string)
comp:lteq a Name of the first variable (string)Check if a <= b and store the resulteq in stdoutfunction comp:lteq { a: my_variable, b: my_other_variable }Check if a <= b and store the resulteq in the standard output
v Name of the second variable (string)b Name of the second variable (string)
Built-in operations
std:out -Will return true if the value of stdout is 0 (success)execute if function std:out run function my_functionWill return nothing if the value of the standard output is not fail. Else this function will also fail