diff options
Diffstat (limited to 'mesecons/presets.lua')
-rw-r--r-- | mesecons/presets.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mesecons/presets.lua b/mesecons/presets.lua index 463a0f8..9988d22 100644 --- a/mesecons/presets.lua +++ b/mesecons/presets.lua @@ -1,4 +1,4 @@ -mesecon.rules={} +mesecon.rules = {} mesecon.state = {} mesecon.rules.default = @@ -23,5 +23,17 @@ mesecon.rules.buttonlike = {x = 1, y =-1, z =-1}, {x = 2, y = 0, z = 0}} +mesecon.rules.buttonlike_get = function(node) + local rules = mesecon.rules.buttonlike + if node.param2 == 2 then + rules=mesecon:rotate_rules_left(rules) + elseif node.param2 == 3 then + rules=mesecon:rotate_rules_right(mesecon:rotate_rules_right(rules)) + elseif node.param2 == 0 then + rules=mesecon:rotate_rules_right(rules) + end + return rules +end + mesecon.state.on = "on" mesecon.state.off = "off" |