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. +
| Function | Arguments | Description | -Example | ||||
|---|---|---|---|---|---|---|---|
| Variables | @@ -81,7 +83,6 @@ execute if std:out run return run function my_functionvar:set |
k Name of the variable (string) |
Set the value of a variable | -function var:set { k: my_variable, v: 10 } |
|||
v Value of the variable (int) |
@@ -91,14 +92,12 @@ execute if std:out run return run function my_function
var:unset |
k Name of the variable (string) |
Remove a varialbe | -function var:unset { k: my_variable } |
|||
var:mv |
k Old variable name (string) |
Rename a variable | -function var:mv { k: my_variable, v: my_renamed_variable } |
||||
v New variable name (string) |
@@ -108,21 +107,18 @@ execute if std:out run return run function my_function
var:inc |
k Name of the variable (string) |
Increment the value of a variable | -function var:inc { k: my_variable } |
|||
var:dec |
k Name of the variable (string) |
Decrement the value of a variable | -function var:dec { k: my_variable } |
||||
var:put |
- | Put the current value of A into this variable | -function var:put { k: my_variable } |
||||
| Arithmetic | @@ -132,50 +128,45 @@ execute if std:out run return run function my_functionmath:add |
k Name of the variable (string) |
Add a number to the current value of a variable and store the result in A | -function 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 A | -function 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 A | -function 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 A | -function 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 A | -function math:mod { k: my_variable, v: 10 } |
||||
v Number to modulo (string) |
+ v Number to modulo (int) |
||||||
| Relation / Compare | @@ -184,51 +175,46 @@ execute if std:out run return run function my_function|||||||
comp:eq |
a Name of the first variable (string) |
- Check if a = b and store the result in stdout |
- function 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 stdout |
- function 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 stdout |
- function 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 stdout |
- function 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 stdout |
- function 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 | @@ -237,7 +223,6 @@ execute if std:out run return run function my_function|||||||
std:out |
- | -Will return true if the value of stdout is 0 (success) | -execute if function std:out run function my_function |
+ Will return nothing if the value of the standard output is not fail. Else this function will also fail |
|||