summaryrefslogtreecommitdiff
path: root/mesecons_microcontroller
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-19 17:34:05 +0100
committerJeija <norrepli@gmail.com>2012-12-19 17:34:05 +0100
commit6b1bfe6391a67471d5a1870c9f3778f1c8bd1353 (patch)
tree598b9cefc933f8706e317fd3a37bd05c2149357f /mesecons_microcontroller
parent2c4a46a5572e9f633faba97a52d2245d17930db4 (diff)
downloadmesecons-6b1bfe6391a67471d5a1870c9f3778f1c8bd1353.tar
mesecons-6b1bfe6391a67471d5a1870c9f3778f1c8bd1353.tar.gz
mesecons-6b1bfe6391a67471d5a1870c9f3778f1c8bd1353.tar.bz2
mesecons-6b1bfe6391a67471d5a1870c9f3778f1c8bd1353.tar.xz
mesecons-6b1bfe6391a67471d5a1870c9f3778f1c8bd1353.zip
Add rule-name system. Every input rule can now have a name, that could help e.g. the microcontroller to know where a signal comes from.
Diffstat (limited to 'mesecons_microcontroller')
-rw-r--r--mesecons_microcontroller/init.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua
index 3117880..6120ade 100644
--- a/mesecons_microcontroller/init.lua
+++ b/mesecons_microcontroller/init.lua
@@ -30,16 +30,16 @@ if (c == 1) then table.insert(rules, {x = 1, y = 0, z = 0}) end
if (d == 1) then table.insert(rules, {x = 0, y = 0, z = -1}) end
local input_rules={}
-if (a == 0) then table.insert(input_rules, {x = -1, y = 0, z = 0}) end
-if (b == 0) then table.insert(input_rules, {x = 0, y = 0, z = 1}) end
-if (c == 0) then table.insert(input_rules, {x = 1, y = 0, z = 0}) end
-if (d == 0) then table.insert(input_rules, {x = 0, y = 0, z = -1}) end
+if (a == 0) then table.insert(input_rules, {x = -1, y = 0, z = 0, name = "A"}) end
+if (b == 0) then table.insert(input_rules, {x = 0, y = 0, z = 1, name = "B"}) end
+if (c == 0) then table.insert(input_rules, {x = 1, y = 0, z = 0, name = "C"}) end
+if (d == 0) then table.insert(input_rules, {x = 0, y = 0, z = -1, name = "D"}) end
mesecon:add_rules(nodename, rules)
local mesecons = {effector =
{
rules = input_rules,
- action_change = function (pos, node)
+ action_change = function (pos, node, rulename)
update_yc(pos)
end
}}