presets.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.pplate = mesecon.mergetable(mesecon.rules.default, {{x=0, y=-2, z=0}})
  17. mesecon.rules.buttonlike =
  18. {{x = 1, y = 0, z = 0},
  19. {x = 1, y = 1, z = 0},
  20. {x = 1, y =-1, z = 0},
  21. {x = 1, y =-1, z = 1},
  22. {x = 1, y =-1, z =-1},
  23. {x = 2, y = 0, z = 0}}
  24. mesecon.rules.flat =
  25. {{x = 1, y = 0, z = 0},
  26. {x =-1, y = 0, z = 0},
  27. {x = 0, y = 0, z = 1},
  28. {x = 0, y = 0, z =-1}}
  29. mesecon.rules.alldirs =
  30. {{x= 1, y= 0, z= 0},
  31. {x=-1, y= 0, z= 0},
  32. {x= 0, y= 1, z= 0},
  33. {x= 0, y=-1, z= 0},
  34. {x= 0, y= 0, z= 1},
  35. {x= 0, y= 0, z=-1}}
  36. mesecon.rules.buttonlike_get = function(node)
  37. local rules = mesecon.rules.buttonlike
  38. if node.param2 == 2 then
  39. rules=mesecon.rotate_rules_left(rules)
  40. elseif node.param2 == 3 then
  41. rules=mesecon.rotate_rules_right(mesecon.rotate_rules_right(rules))
  42. elseif node.param2 == 0 then
  43. rules=mesecon.rotate_rules_right(rules)
  44. end
  45. return rules
  46. end
  47. mesecon.state.on = "on"
  48. mesecon.state.off = "off"