From d4dddc41ec199ffc73f1ad10f900b42c3164a46f Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 10 May 2013 18:28:57 -0400 Subject: add flow sensor. Sends mesecons signal when water is flowing through it. --- autoplace.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'autoplace.lua') diff --git a/autoplace.lua b/autoplace.lua index dbcc423..ddfdb76 100644 --- a/autoplace.lua +++ b/autoplace.lua @@ -143,6 +143,28 @@ function pipes_scansurroundings(pos) pzp=1 end +-- ...flow sensors... + + if (string.find(nxm.name, "pipeworks:flow_sensor") ~= nil) + and (nxm.param2 == 0 or nxm.param2 == 2) then + pxm=1 + end + + if (string.find(nxp.name, "pipeworks:flow_sensor") ~= nil) + and (nxp.param2 == 0 or nxp.param2 == 2) then + pxp=1 + end + + if (string.find(nzm.name, "pipeworks:flow_sensor") ~= nil) + and (nzm.param2 == 1 or nzm.param2 == 3) then + pzm=1 + end + + if (string.find(nzp.name, "pipeworks:flow_sensor") ~= nil) + and (nzp.param2 == 1 or nzp.param2 == 3) then + pzp=1 + end + -- ...spigots... if (string.find(nxm.name, "pipeworks:spigot") ~= nil) -- cgit v1.2.3