Integrated Scripting
ATTENTION: This mod requires the Cyclops Core library and Integrated Dynamics mod!
What is this mod?
Integrated Scripting opens up the possibility for you to create scripts for automating complex operations in Integrated Dynamics networks. If the standard capabilities of Integrated Dynamics seem limited for implementing complex tasks, this mod will become your indispensable assistant.
Key Features
Using scripts, you can easily perform operations that would require complex setups in regular Integrated Dynamics:
- Calculation of statistical indicators: median, standard deviation
- Creating predicate filters for Integrated Tunnels exporters and importers
- Calculating the average stack size of items in a chest by specific tag
- Displaying average energy consumption over the last minute
- Determining the breaking speed of a block with the tool in your hand
- Easy sharing of scripts with other players via copy-paste
Main Mod Elements
Scripting Terminal
The main addition of the mod is the Scripting Terminal, allowing you to write code in JavaScript language. Created scripts are saved in variable cards and can be used throughout your Integrated Dynamics network.
Scripting Drives
Special items for storing script data. They are installed in appropriate slots, making scripts available for use and editing in your network.
Editor Functionality
The Scripting Terminal offers a full-featured editor for writing code. Script elements (variables, functions) can be bound to Integrated Dynamics variables, which are then used throughout the network as regular variables.
Bonus for advanced users: If you have direct access to world files, you can edit scripts in your favorite IDE!
State Preservation
The mod allows tracking values between function executions - perfect for calculating sums, averages, and other accumulated data. For example, you can calculate average energy consumption over a specific period of time.
Debugging and Logging
For debugging complex operations, there is a message logging system that can be viewed later to analyze script performance.
Technical Features
Scripts are executed by the high-performance Graal.JS JavaScript engine based on Graal VM from Oracle. Special attention was paid to performance and security during mod development.
By default, JavaScript is executed with the strictest Graal security settings. Server administrators can relax these settings if players need input-output operations for working with external files. The maximum script execution size can also be configured to prevent performance issues.
Complete documentation and learning materials are available in-game through the "On the Dynamics of Integration" book from Integrated Dynamics.