diff options
-rw-r--r-- | init.lua.save | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/init.lua.save b/init.lua.save deleted file mode 100644 index a577ef4..0000000 --- a/init.lua.save +++ /dev/null @@ -1,48 +0,0 @@ --- This function somewhat "borrowed" from Mesecons -local light_controller_scan = function (pos) - local objs = minetest.get_objects_inside_radius(pos, mesecon.setting("detector_radius", 6)) - for k, obj in pairs(objs) do - local isname = obj:get_player_name() - if (isname ~= "") then - return true - end - end - return false -end - - - -local emit_signals = function(pos) - local meta = minetest.get_meta(pos) - if meta:get_string("locked")~="true" then - meta:set_string("locked","true") - digiline:receptor_send(pos, digiline.rules.default, "main", "RED") - minetest.after(5,function(pos) - digiline:receptor_send(pos, digiline.rules.default, "side", "GREEN") - minetest.after(10,function(pos) - digiline:receptor_send(pos, digiline.rules.default, "side", "RED") - minetest.after(5,function(pos) - digiline:receptor_send(pos, digiline.rules.default, "main", "GREEN") - minetest.after(15,function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("locked","false") - end,pos) - end,pos) - end,pos) - end,pos) - end -end - - -minetest.register_node("lightcontroller:trafficnext", { - description = "TrafficNeXt SoC", - tiles = {"default_stone.png"}, - groups = {cracky=3, stone=1}, - sounds = default.node_sound_stone_defaults(), - digiline = - { - receptor = {}, - effector = {}, - }, - on_punch = function(pos) emit_signals(pos) end -}) |