mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
MS-ES v1.1 documentation
This commit is contained in:
parent
daf1275fc2
commit
fd3a8147ec
@ -234,9 +234,17 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
|
||||
"",
|
||||
"Example: `/ntmserver set AUTOCAL_MAX_CLOCK 10` -> Sets the max clock speed to 10.",
|
||||
"",
|
||||
"## About MS-ES v1.1",
|
||||
"MS-ES v1.1 (or MS-ES1 FEID, \"First Extended Instruction Set\") is the second released version of the AUTOCAL's script interpreter. It features various useful additions such as text splitting, substrings, a stack-based buffer and world time grabbing. The stack for example allows for a call stack, which means that functions that were jumped to can now be nested without having to save the most recent jumping points in dedicated variables. The string split and substring operations now allow for reversing concat operations and potentially grabbing individual coordinates out of combined coordinate strings. A single RoR send operation can now send serialized data (i.e. multiple values in a single text string) which can now finally be de-serialized again.",
|
||||
"",
|
||||
"Programs witten in MS-ES1 are largely compatible with MS-ES1.1 interpreters, however, MS-ES1.1 now imposes a character limit of 256 on buffered values.",
|
||||
"",
|
||||
"## About the Buffer",
|
||||
"The buffer is a single \"slot\" of information that can be used for many commands. Some commands produce an output which is saved to the buffer, some commands modify the contents of the buffer, and some commands use the buffer's contents. The buffer's contents can also be saved permanently as a named variable, and named variables can be written back into the buffer again if needed. The buffer persists as long as the AUTOCAL unit is running, should it restart or shut down, the buffer's contents are lost.",
|
||||
"",
|
||||
"## About the Stack (v1.1)",
|
||||
"The stack functions similar to the buffer, as in there is only one single stack that can be accessed per AUTOCAL unit, and it can save arbitrary text data. The difference being, while the buffer can only store one value, the stack can store a list of up to 256 values. Values on a stack follow the last-in-first-out principle, i.e. the most recently added values are read first. The stack supports `push` (adding new elements), `pop` (reading and removing elements) and `peek` (reading but not removing elements).",
|
||||
"",
|
||||
"## About Variables",
|
||||
"MS-ES1 allows named variables to be saved for later use. There is no limit to how many variables can be saved. All variables are text (\"Strings\"), however depending on the command and context, that text may be interpreted as a number (both full and decimal). Variables, much like the buffer, are also stored as long as the program is running, if the AUTOCAL unit shuts down, all stored variables are lost.",
|
||||
"",
|
||||
@ -325,6 +333,15 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
|
||||
"",
|
||||
"-> Will buffer the value `Horseshoe` and then save it to the variable called \"item\".",
|
||||
"",
|
||||
"### push (v1.1)",
|
||||
"`push [value]` will add the supplied value to the stack. If no value is supplied, it will write the buffer's contents to the stack instead. Do note that the stack can only hold up to 256 values! Supports variable substitution!",
|
||||
"",
|
||||
"### pop (v1.1)",
|
||||
"`pop` will remove the most recently added value from the stack and write it to the buffer.",
|
||||
"",
|
||||
"### peek (v1.1)",
|
||||
"`peek` will write the most recently added value from the stack to the buffer, but without removing it from the stack like `pop` would.",
|
||||
"",
|
||||
"### eval",
|
||||
"`eval [statement]` will evaluate the supplied statement as a mathematical expression. In short, anything NTM's calculator can make sense of (the one you open with N by default), this function can do the same. The statement is optional, if no statement is supplied, then it will try to use the buffer's contents as the statement. `eval` produces **decimal** values and not whole number **integers**, so for use in RoR signals, the output needs to be rounded! The result of the calculation is then saved to the buffer. Supports variable substitution!",
|
||||
"",
|
||||
@ -387,6 +404,54 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
|
||||
"### leb",
|
||||
"`leb <value>` - less than or equal buffer.",
|
||||
"",
|
||||
"### splitter (v1.1)",
|
||||
"`splitter <value>` sets the splitter character (or text) which is used for splitting operations. This value exists once per AUTOCAL, similar to the clockspeed. By default, the splitter is set to `;`. Supports variable substitution!",
|
||||
"",
|
||||
"### split (v1.1)",
|
||||
"`split <index>` will split the buffer's contents, grab the fragment with the desired index, and write its contents to the buffer.",
|
||||
"",
|
||||
"Example:",
|
||||
"`buffer cats;and;dogs`",
|
||||
"`split 3`",
|
||||
"",
|
||||
"-> Will buffer the value of the third fragment, being `dogs`.",
|
||||
"",
|
||||
"### splitcount (v1.1)",
|
||||
"`splitcount` will split the buffer's contents, count the number of fragments created, and write that value to the buffer.",
|
||||
"",
|
||||
"Example:",
|
||||
"`buffer cats;and;dogs;and;birds`",
|
||||
"`splitcount`",
|
||||
"",
|
||||
"-> Will buffer the number of fragments, being `5`.",
|
||||
"",
|
||||
"### length (v1.1)",
|
||||
"`length` will count the number of characters in the buffer's stored text, and write that value to the buffer.",
|
||||
"",
|
||||
"Example:",
|
||||
"`buffer cats and dogs`",
|
||||
"`lenght`",
|
||||
"",
|
||||
"-> Will buffer the number of characters in `cats and dogs`, being `13`.",
|
||||
"",
|
||||
"### first (v1.1)",
|
||||
"`first <amount>` will grab the first x characters from the buffer and write them to the buffer. This is a substring operation that always starts at the first letter.",
|
||||
"",
|
||||
"Example:",
|
||||
"`buffer cats and dogs`",
|
||||
"`first 4`",
|
||||
"",
|
||||
"-> Will buffer the first four characters of the buffer, `cats`.",
|
||||
"",
|
||||
"### last (v1.1)",
|
||||
"`last <amount>` will grab the last x characters from the buffer and write them to the buffer. This is a substring operation that always ends at the last letter.",
|
||||
"",
|
||||
"Example:",
|
||||
"`buffer cats and dogs`",
|
||||
"`last 4`",
|
||||
"",
|
||||
"-> Will buffer the last four characters of the buffer, `dogs`.",
|
||||
"",
|
||||
"### send",
|
||||
"`send <channel>` will send a Redstone-over-Radio signal over the supplied channel, with the signal's value being the current buffer's value. Sending repeatedly over the same channel requires waiting for a full game tick, so using `endtick` after sending is advised. Supports variable substitution!",
|
||||
"",
|
||||
@ -412,6 +477,12 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
|
||||
"",
|
||||
"-> Will take the signal from the RoR channel \"input\", multiply it by 100, and send that value on the channel \"output\".",
|
||||
"",
|
||||
"### poll (v1.1)",
|
||||
"`poll <channel>` will listen to the supplied RoR channel and write the signal to the buffer. Unlike `listen`, it will only detect signals from the last tick. Supports variable substitution!",
|
||||
"",
|
||||
"### worldtime (v1.1)",
|
||||
"`worldtime` will save the amount of ticks since world creation to the buffer. If the result is saved to a variable, it can be compared later, allowing for precise and clockspeed-agnostic timers.",
|
||||
"",
|
||||
"## Advanced",
|
||||
"",
|
||||
"### Conditional Branches",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user