presets.lua 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. mesecon.rules = {}
  2. mesecon.state = {}
  3. mesecon.rules.default =
  4. {{x=0, y=0, z=-1},
  5. {x=1, y=0, z=0},
  6. {x=-1, y=0, z=0},
  7. {x=0, y=0, z=1},
  8. {x=1, y=1, z=0},
  9. {x=1, y=-1, z=0},
  10. {x=-1, y=1, z=0},
  11. {x=-1, y=-1, z=0},
  12. {x=0, y=1, z=1},
  13. {x=0, y=-1, z=1},
  14. {x=0, y=1, z=-1},
  15. {x=0, y=-1, z=-1}}
  16. mesecon.rules.buttonlike =
  17. {{x = 1, y = 0, z = 0},
  18. {x = 1, y = 1, z = 0},
  19. {x = 1, y =-1, z = 0},
  20. {x = 1, y =-1, z = 1},
  21. {x = 1, y =-1, z =-1},
  22. {x = 2, y = 0, z = 0}}
  23. mesecon.rules.flat =
  24. {{x = 1, y = 0, z = 0},
  25. {x =-1, y = 0, z = 0},
  26. {x = 0, y = 0, z = 1},
  27. {x = 0, y = 0, z =-1}}
  28. mesecon.rules.buttonlike_get = function(node)
  29. local rules = mesecon.rules.buttonlike
  30. if node.param2 == 2 then
  31. rules=mesecon:rotate_rules_left(rules)
  32. elseif node.param2 == 3 then
  33. rules=mesecon:rotate_rules_right(mesecon:rotate_rules_right(rules))
  34. elseif node.param2 == 0 then
  35. rules=mesecon:rotate_rules_right(rules)
  36. end
  37. return rules
  38. end
  39. mesecon.state.on = "on"
  40. mesecon.state.off = "off"