summaryrefslogtreecommitdiff
path: root/autoplace.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 18:28:57 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 18:28:57 -0400
commitd4dddc41ec199ffc73f1ad10f900b42c3164a46f (patch)
treee2d61bc3a91a9042499279ed09179c3f1cd2f67c /autoplace.lua
parent509fac3845cc06b5b1673d9516fd998265058298 (diff)
downloadpipeworks-d4dddc41ec199ffc73f1ad10f900b42c3164a46f.tar
pipeworks-d4dddc41ec199ffc73f1ad10f900b42c3164a46f.tar.gz
pipeworks-d4dddc41ec199ffc73f1ad10f900b42c3164a46f.tar.bz2
pipeworks-d4dddc41ec199ffc73f1ad10f900b42c3164a46f.tar.xz
pipeworks-d4dddc41ec199ffc73f1ad10f900b42c3164a46f.zip
add flow sensor. Sends mesecons signal when water is flowing through it.
Diffstat (limited to 'autoplace.lua')
-rw-r--r--autoplace.lua22
1 files changed, 22 insertions, 0 deletions
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)