I recently found mod named LuaCombinator2, and I liked it's idea but not implementation, so I 'improved' it (if I correctly understood CC BY-SA 4.0 license it is fine). So here it is:
Adds combinators programmed with lua.
"Sandboxed" because that is main difference from original mod - each combinator's code works isolated from other's and from game api, so can only interact world with circuit network signals using special variables named: rednet, greennet, output, which are tables indexed by signal name (like 'signal-A'). rednet and greennet are read-only, to send signals write them to output table (like output['signal-A'] = 1 ). Also there is special variable delay: after executing code of combinator once, next execution will be after delay ticks passed, otherwise - on next tick. Don't place infinite (or too long) loops inside - it will hang the game. However, currently it is the only (known) way to negatively affect game with 'bad' code, because unlike in original mod, game api or any external variables are inaccessible (please report as bug otherwise).
Unlike in original mod, global (from inside combinator perspective) variables are always preserved, so there is no need to use special table 'var' to save them. For compatibility, 'var' is defined by default as empty table, but otherwise it is regular variable.
Compatible with code for LuaCombinator2, if that code use only circuit networks and pure lua. Examples from it's page all works.
Optimized to have less overhead on reading/writing signals. Currently up to 40% faster than original (in benchmark where lots of combinators reads and writes signals each tick).
Topics and discussion about specific mods
1 post • Page 1 of 1