diff options
author | Kyle <kyle.kylina@gmail.com> | 2012-09-01 22:06:25 -0700 |
---|---|---|
committer | Kyle <kyle.kylina@gmail.com> | 2012-09-01 22:06:25 -0700 |
commit | 845c27512171e3f4aa05ea9bc931bd8920696c2f (patch) | |
tree | 892ea906274fb34c37fd0a97afcc947deed28d78 /mesecons_gates | |
parent | 0f7a87538d435a758d364e821c08c1cfa65e998c (diff) | |
download | mesecons-845c27512171e3f4aa05ea9bc931bd8920696c2f.tar mesecons-845c27512171e3f4aa05ea9bc931bd8920696c2f.tar.gz mesecons-845c27512171e3f4aa05ea9bc931bd8920696c2f.tar.bz2 mesecons-845c27512171e3f4aa05ea9bc931bd8920696c2f.tar.xz mesecons-845c27512171e3f4aa05ea9bc931bd8920696c2f.zip |
registering the on receptor makes placing a mesecon on the out port of
the gate update the circuitry after it
Diffstat (limited to 'mesecons_gates')
-rw-r--r-- | mesecons_gates/init.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index ce22f1d..af7d87a 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -1,3 +1,6 @@ +outrules = { + {x=1, y=0, z=0}, +} gates = {"diode", "not", "nand", "and", "xor"} for g in ipairs(gates) do gate = gates[g] if g < 3 then @@ -13,20 +16,22 @@ for g in ipairs(gates) do gate = gates[g] } end for on=0,1 do + nodename = "mesecons_gates:"..gate if on == 1 then onoff = "on" + drop = nodename.."_off" groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon = 3} - drop = "mesecons_gates:"..gate.."_off" description = "You hacker you!" + nodename = nodename.."_"..onoff + mesecon:add_receptor_node(nodename, outrules) else onoff = "off" groups = {dig_immediate=2, mesecon = 3} - drop = nodename description = gate.." Gate" + nodename = nodename.."_"..onoff + --mesecon:add_receptor_node_off(nodename, rules) end - nodename = "mesecons_gates:"..gate.."_"..onoff - node_box = { type = "fixed", fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }, |