From 845c27512171e3f4aa05ea9bc931bd8920696c2f Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 1 Sep 2012 22:06:25 -0700 Subject: registering the on receptor makes placing a mesecon on the out port of the gate update the circuitry after it --- mesecons_gates/init.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mesecons_gates') 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 }, -- cgit v1.2.3