Moon Logic 2


Adds programmable Lua combinator. Based on Sandboxed LuaCombinator and LuaCombinator2 mods.

Content
a day ago
2.0
324
Circuit network

Changelog

Version: 0.1.8
Date: 2024-11-24
  Bugfixes:
    - Fixed copy-popup of virtual signals not opening
Version: 0.1.7
Date: 2024-11-23
  Bugfixes:
    - Fixed typo in update_signal_types_table
    - Fixed fatal error when signal type is nil
Version: 0.1.6
Date: 2024-11-22
  Bugfixes:
    - Fixed On_Built_Entity event not called by SpaceStation build
Version: 0.1.5
Date: 2024-11-21
  Bugfixes:
    - Fixed Recipe signals not working
    - Fixed signal retrival in cn_sig
  Features:
    - Added a ui to copy signals
Version: 0.1.4
Date: 2024-11-12
  Features:
    - Added prototype in _api
    - Added click on label to put signal name at the end of the code editor.
Version: 0.1.3
Date: 2024-11-12
  Bugfixes:
    - Fixed pairs(red/green) not outputting quality signals
    - Fixed normal prefix of signals not returning normal quality signals
    - Fixed concatenate on a nil value on signals
Version: 0.1.2
Date: 2024-11-09
  Features:
    - Added support for item quality.
Version: 0.1.1
Date: 2024-11-09
  Bugfixes:
    - Fixed crash on statrup because of change mod name
Version: 0.1.0
Date: 2024-11-09
  Bugfixes:
    - Fixed crash on startup with factorio version 2.0
Version: 0.0.83
Date: 2022-09-27
  Bugfixes:
    - Fix errors on hidden-item and nil signals, which seem to happen in Space Exploration mod.
Version: 0.0.82
Date: 2022-06-25
  Bugfixes:
    - Fix main GUI code textbox having two scrollbars.
Version: 0.0.81
Date: 2022-06-22
  Features:
    - Add remote.call('mlc', 'run', <uid>[, <count>]) interface for benchmarking with /measured-command.
Version: 0.0.80
Date: 2022-06-20
  Features:
    - Pausing variables-window now makes it editable, to allow easy Ctrl-A/Ctrl-C from there.
Version: 0.0.78
Date: 2022-03-11
  Features:
    - Skip printing vars prefixed by "__" in variables window, to intentionally unclutter it that way.
Version: 0.0.77
Date: 2022-03-10
  Features:
    - Add dedicated Pause/Unpause button to variables-window.
Version: 0.0.76
Date: 2022-03-10
  Features:
    - Shift-click on variables-window button now opens or updates it in a paused state.
Version: 0.0.75
Date: 2022-01-17
  Bugfixes:
    - Fix GUI signal-printer panel stopping on zero-value signals in output table bug, introduced in 0.0.66.
Version: 0.0.74
Date: 2022-01-16
  Bugfixes:
    - Fix lua error when assigning non-string key types to output table.
Version: 0.0.73
Date: 2021-10-19
  Bugfixes:
    - Fix gui crash after assigning unprintable special table to an output signal, e.g. "out.a = red".
Version: 0.0.72
Date: 2021-07-18
  Bugfixes:
    - Implement storing code in blueprints when event.mapping is invalidated by mods.
Version: 0.0.69
Date: 2021-07-16
  Features:
    - Add combinator code storage in a blueprint via entity tags.
Version: 0.0.67
Date: 2021-03-04
  Bugfixes:
    - Fix inputs that were broken in previous release.
Version: 0.0.66
Date: 2021-03-03
  Features:
    - Add mandatory signal disambiguation via prefixes.
      This happens if same name can refer to multiple signal types (item, fluid, virtual).
      Prefixes are always allowed, but only required in case of name ambiguity (some mods do that).
Version: 0.0.65
Date: 2021-03-03
  Features:
    - Add shift+right-click on variables-window button to clear "out" outputs-table.
  Changes:
    - Failing power no longer resets combinator outputs, to be consistent with lua env handling.
Version: 0.0.64
Date: 2021-02-27
  Bugfixes:
    - Handle odd case when opening same combinator when code box is focused.
      Was opening arithmetic combinator gui before and issuing "already opened" msg.
Version: 0.0.63
Date: 2021-02-27
  Bugfixes:
    - Fix entity-cloned event, broken by 0.0.61 changes, notably used in Space Exploration mod.
Version: 0.0.62
Date: 2021-02-24
  Changes:
    - Minor ota_update_from_uid optimizations to skip work if code or uid is the same.
Version: 0.0.61
Date: 2021-02-24
  Bugfixes:
    - Fix ota_update_from_uid not working unless GUI is open.
Version: 0.0.60
Date: 2021-02-19
  Changes:
    - Don't expose signals for items flagged as hidden, as these shouldn't appear in combinator GUIs either.
Version: 0.0.59
Date: 2021-02-16
  Bugfixes:
    - Add compatibility tweak for Attach Notes mod, using same-named "virtual" signals over "item".
    - Fix "nil" values that can occasionally pop-up instead of zeroes in output table when using color outputs.
Version: 0.0.58
Date: 2021-02-12
  Features:
    - Add special "irq_min_interval" value to make it easier to use "irq" when input signal is not a pulse.
Version: 0.0.57
Date: 2021-02-12
  Bugfixes:
    - Fix "irq" value not being reset properly when combinator code runs.
Version: 0.0.56
Date: 2021-02-10
  Features:
    - Add special "irq" value to set input signal name that can be non-zero to interrupt the delay setting.
Version: 0.0.54
Date: 2021-01-20
  Bugfixes:
    - Fix copying MLC combinator settings and cloning them in /editor, broken by 0.0.52 changes.
Version: 0.0.52
Date: 2021-01-20
  Features:
    - Add ability to set different signal values on different wires, for example: out['red/coal'] = 5
Version: 0.0.51
Date: 2021-01-08
  Bugfixes:
    - Fix GUI button appearance for changes in how styles are applied in Factorio 1.1.7+.
Version: 0.0.48
Date: 2020-12-15
  Features:
    - Add hotkey to open Moon Logic Combinator under pointer from anywhere (default Ctrl+E).
Version: 0.0.47
Date: 2020-12-08
  Bugfixes:
    - Fix bug with output signals being linked when shift-click copying combinator settings until next save/load.
Version: 0.0.45
Date: 2020-12-01
  Features:
    - Add handling for on_entity_cloned event, raised with /editor and some mods.
Version: 0.0.43
Date: 2020-11-24
  Features:
    - Minor fixes for Factorio-1.1 (experimental version) compatibility.
Version: 0.0.42
Date: 2020-10-22
  Features:
    - Add optional dependency on Schall Circuit Group mod, adding this combinator to its tab, if also installed.
Version: 0.0.41
Date: 2020-10-21
  Features:
    - Print invalid signals stuck in "out" table on the right of the GUI window instead of hiding them.
Version: 0.0.40
Date: 2020-10-06
  Features:
    - Implement lua length (#) operator for input and output tables, counting non-zero values there.
Version: 0.0.38
Date: 2020-10-01
  Bugfixes:
    - Fix deconstructing the combinator not returning the item.
Version: 0.0.37
Date: 2020-09-10
  Changes:
    - Querying unknown input signal names now raises errors instead of returning 0.

  Bugfixes:
    - Fix crash when trying to set signal-anything or signal-everything on the outputs.
Version: 0.0.35
Date: 2020-09-09
  Features:
    - Combinator code can now be copied from the original one when blueprinted,
      but only if original one still exists at the time when new one is placed by a robot.
    - Add "ota_update_from_uid" lua env var support to copy code from another mlc.
Version: 0.0.34
Date: 2020-09-09
  Features:
    - Secret feature: re-introduce access to factorio apis under "_api" global in env.
      Unlike with combinator input/output values, it's easy to break the game through this by mistake,
      so I'd suggest never using it, unless you absolutely know what you are doing.
Version: 0.0.31
Date: 2020-09-08
  Bugfixes:
    - Fix GUI width/height constants not taking display_scale into account.
Version: 0.0.30
Date: 2020-09-07
  Bugfixes:
    - Fix displaying inputs as "inputs - outputs", from all the way back when this was a constant combinator!
Version: 0.0.29
Date: 2020-09-07
  Features:
    - Add option to disable undo/redo history for way more smooth and pleasant editing experience.
      Highly recommended for anyone not actually using those buttons!
    - Preset tooltips now have nicer text and can use comments from code for tooltip on the button.

  Bugfixes:
    - Fix "save" button adding trailing newlines to code.
    - Fix copying from textbox with error getting factorio rich-text markup tag in there.
Version: 0.0.28
Date: 2020-09-06
  Features:
    - Add "GUI Signals Update Interval" setting for more UPS-efficient GUI updates.
    - Add small item icons to an input/output signals list.
    - Highlight code error line on save and after code runs, if gui for it is opened.
    - Enable gvv mod support (used to debug other mods), only if it's installed and enabled.

  Bugfixes:
    - Fix showing signal values in GUI that are <0, oops.
Version: 0.0.23
Date: 2020-09-06
  Features:
    - Right-click on "open environment" button will clear the env, mentioned in button tooltip.

  Changes:
    - Hide internals of red/green input tables in vars window, there's other display for them anyway.

  Bugfixes:
    - Fix broken locale string and a tooltip for environment display window.
    - Fix Ctrl-F (env window) hotkey not working without main GUI open.
Version: 0.0.19
Date: 2020-09-06
  Features:
    - Add toggle-able and auto-updating combinator environment display window (Ctrl-F).
    - Secret feature: expose factorio LuaRemote interface as game.remote.
      This is to allow people to use "signalstrings" or such helper mods from code.
      Using any other mod interfaces can break the game, as they're only intended for mods devs!

  Changes:
    - Only 20 preset buttons instead of 21, as more won't fit on that button-line.
    - "Close UIs" hotkey now closes all windows created by this mod, not just the main one.

  Bugfixes:
    - Output signals on the right are now read from combinator directly, not output table.
Version: 0.0.18
Date: 2020-09-06
  Features:
    - Add some colors highlight keywords in an in-game help window.

  Changes:
    - game.print() now behaves more like lua print(), and game.print_color() is for colors.
    - Make help window scrollable if necessary and set UI limits from player screen height.
Version: 0.0.17
Date: 2020-09-05
  Bugfixes:
    - Chain-fix for a bad fix in 0.0.14 for crash bug added in 0.0.12 - nice.
Version: 0.0.16
Date: 2020-09-05
  Features:
    - New mod thumbnail, with a new combinator sprite on it.

  Changes:
    - Use tick (arachnid) instead of a bug on the "moon logic error" signal, to match the name.
Version: 0.0.14
Date: 2020-09-05
  Features:
    - Convert boolean values to 1/0 for an easy on/off signals.

  Bugfixes:
    - Fix signal header on the right to say "wire signals", as they're not only inputs anymore.
    - Fix crash when opening different mlc gui when textbox is focused, introduced in 0.0.12.
Version: 0.0.13
Date: 2020-09-04
  Features:
    - New combinator graphics and icons, updated some descriptions.
    - Dynamic state output on combinator LED display (blank, run, sleep, error, no-power).
    - Combinator now stops working when its power goes into red.

  Changes:
    - Bugs on the combinator will now set output error signal on it.
    - 6KW energy usage (regular combinators = 1KW, lamp = 5KW).

  Bugfixes:
    - Fix undo/redo hotkeys.
    - Fix clearing output table via "out = {}" and when using "clear" UI button.
    - Fix running serpent.block/line on overloaded input ro-tables.
    - Logging via game.log doesn't print whole function code anymore.
Version: 0.0.12
Date: 2020-09-04
  Changes:
    - Replace combinator type/looks from 1x1 to 2x1 one, with separate inputs and outputs.
      All existing old combinators from saved games will be removed on migration,
      but their non-duplicate/empty code is stored on spare preset buttons, with notification about it.
    - Currently combinator looks exactly like arithmetic one, need to update sprites/icons/thumbnails.
    - Improve help text for various unclear things that were reported.
    - Display output signals in the GUI, but separately from inputs.
    - Pressing Esc (or default "close guis") key now unfocuses code textbox first, closes on second press.

  Bugfixes:
    - Fix wrong line being highlighted for lua errors with leading empty lines.
Version: 0.0.11
Date: 2020-09-04
  Changes:
    - Only signal input values are reported in GUI on the right, not inputs+outputs, as latter was confusing.

  Bugfixes:
    - Fix debug=true log not mentioning all keys if pairs() was run on inputs.
Version: 0.0.9
Date: 2020-09-04
  Changes:
    - Change logging stuff to use log() instead of print() - guess latter doesn't actually ends up in log.
Version: 0.0.8
Date: 2020-09-04
  Bugfixes:
    - Fix crash when loading saves with a combinator GUI left open.
Version: 0.0.7
Date: 2020-09-03
  Bugfixes:
    - Fix crash when copying combinator settings via shift-click.
Version: 0.0.6
Date: 2020-09-02
  Features:
    - Add hotkeys, but they don't work while editing text anyway.
    - Add "clear" GUI button to reset combinator code.
    - Major combinator GUI layout/internals update.
Version: 0.0.5
Date: 2020-09-02
  Bugfixes:
    - Fix wire labels not being used in debug=true logging output.
    - Fix crash on script_raised_revive event from other mods like creative-mode.
Version: 0.0.4
Date: 2020-09-02
  Features:
    - Add startup mod options to change red/green lua env vars and gui labels.
      Useful with other mods that change colors.
Version: 0.0.3
Date: 2020-09-02
  Bugfixes:
    - Fix on_pre_player_mined_item error when removing combinator.
    - Fix error line highlight in code on opening combinators.
    - Help text window fixes.
Version: 0.0.2
Date: 2020-09-02
  Features:
    - Remove separate input/output things and 2x1 combinator variant,
      not sure what's a good use-case for these.
    - Add "debug" flag to dump combinator code inputs/outputs to factorio log.
    - Misfeature: multiplayer is probably broken, not sure if worked before,
      with a bunch of local state assigned on ticks.

  Bugfixes:
    - Fixed closing GUI on Esc key.

  Changes:
    - Major control code rewrite, ~600 less lines of stuff, but likely with a lot of new bugs, unfortunately.
    - Code environment changes - rednet -> red, geennet -> green, output -> out, all return 0 for missing keys, etc.
Version: 0.0.1
Date: 2020-08-31
  Features:
    - Initial release, based on IWTDU's Sandboxed LuaCombinator mod code
      (which in turn is based on OwnlyMe's LuaCombinator2), but with less features.

  Changes:
    - Remove all auto-indentation and syntax highlighting -
      it's not a substitute for vim/emacs, just paste/tweak code there.
    - Remove all blueprint serialization code - one of these can easily control everything in the game,
      use simplier combinators for basic arithmetic.
    - GUIs have fixed position, not bouncing somewhere around screen center, and are generally fixed-up a bit.