A collection of Factorio Lua scripts that are useful.
Most of these scripts are designed for use in sandbox mode. Because of this, they generally won't reference any external packages so that the script can easily be copy pasted into the Lua Snippets execution tab.
Additionally, there are a couple utility command line scripts to copy these scripts into your local snippets all at once.
The primary purpose of this is to enable copying over hotbars from one save to another.
Exports the player's current hotbars as a JSON object and writes them to a file. Primarily used to generate the JSON that import_hotbars will take in the future as input.
Imports the hotbars that are listed to the player's current hotbars and ensures that all items have at least one stack of contents.
Mainly used in conjunction with export_hotbars to enable transferring of hotbars between saves.
Returns a set of combinators containing ids for items that may be used for indexing. Each item should have a unique identifier.
Creates a set of ConstantCombinators that have each item with its corresponding stack size as a value.