Sandboxed LuaCombinator

by IWTDU

Program combinators with lua. Now there is a version with outputs isolated from inputs!

Content
4 years ago
0.17 - 0.18
15
Circuit network

i Signal Strings Library?

4 years ago

Any chance of adding access to the Signal Strings Library functions? It would be really handy in some cases. See the API calls here: https://mods.factorio.com/mod/signalstrings

4 years ago

I got it working! Here is the code needed to add the string_to_signals function. Insert just after the definition of sandbox_env_std. (And add "?signalstrings" to dependencies in info.json.)

if remote.interfaces['signalstrings'] then
  function string_to_signals(input)
    local sigs = remote.call('signalstrings','string_to_signals', input)
    local output = {}
    for _,sig in pairs(sigs) do
      if sig.signal and sig.signal.name then
        output[sig.signal.name] = sig.count
      end
    end
    return output
  end
  sandbox_env_std.string_to_signals = string_to_signals
end
4 years ago
(updated 4 years ago)

Can you please also add the Lua "bit32" library? Full listing here: https://www.lua.org/manual/5.2/manual.html#6.7

This mod is AMAZING when paired with Stringy Train Stops!

4 years ago

Added in 0.4.1, using your code (thanks for that!).

4 years ago

Thank you!

New response