Aims to provide a more convenient approach to creating logic circuits in the game scrap mechanic. Currently limited to command-line actions FOR WINDOWS.
exit or quit or q Exits the program
clear Writes the ANSI code to clear the terminal. If your terminal does not support it, you will need to fix this yourself
reload
Reloads all files in src/cmds/
This is a terrible piece of code as it is dependent on Windows dir
command. This should be easy enough to port by changing the command to a find
-based derivative
load This is a command that is loaded from src/cmds/load.lua Takes one argument corresponding to the path+file for blueprint.json found in scrap mechanic blueprints
save This is a command that is loaded from src/cmds/save.lua Takes zero-one arguments, with its behaviour changing depending. Should no arguments be provided, it will overwrite the blueprint that is currently loaded (or error if there is none) If an argument is provided, it will correspond to the path+file and will save there
select This is a command that is loaded from src/cmds/select.lua This is a complex command that is used to filter what blocks are currently selected and has a few sub-commands Please note that most fields have not been implemented If the provided value is NOT a sub-command, then it is treated as a field to use when searching. These fields are hard-coded via if-else blocks in order to reduce some inconveniences that are present in the structure of a scrap mechanic blueprint Otherwise it will check if it is a subcommand such as the following;
- clear or reset or all Adds all blocks to the selection
- none Removes all blocks from the selection
- log or print
writes the json data from all blocks that are selected. If followed by pretty or p, then it will use
json:encode_pretty
to produce the text rather thanjson:encode
Currently the only fields implemented are color/colour which supports comparing individual channels of rgb or as a whole The filter can use ==,!=,>,>=,< and <= to compare both rgb and rgb channels. When performing a comparason on all channels, i.e; rgb, it will act like a 3D-vector comparason, where it is only greater if all channels are true, otherwise it is false and will be removed from the selection
Its worth noting that the selection by default selects all blocks and will exclude blocks as they fail to meet selection criteria.
Additionally, running multiple selection commands after one another will not reset the selection but rather refine it, i.e; only blocks that meet select ...
AND select ....
will remain selected.
Currently no command to modify these fields exists.