Scorpionfien

house 2

Jun 25th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. os.loadAPI("touchpoint")
  2.  
  3. --Set Up Pages
  4. local page1 = touchpoint.new("monitor_")
  5. local page2 = touchpoint.new("monitor_")
  6. local page3 = touchpoint.new("monitor_")
  7. local page4 = touchpoint.new("monitor_")
  8.  
  9. --Functions
  10. --Ignores Input
  11. function doNothing()
  12. sleep(0.5)
  13. end
  14.  
  15. --Redstone On
  16. function rsOn()
  17. page2:flash("On")
  18. rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.lightBlue))
  19. end
  20.  
  21. --Redstone Off
  22. function rsOff()
  23. page2:flash("Off")
  24. rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.lightBlue))
  25. end
  26.  
  27. --Ender On
  28. function enOn()
  29. page3:flash("On")
  30. rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.lime))
  31. end
  32.  
  33. --Ender Off
  34.  
  35. function enOff()
  36. page3:flash("Off")
  37. rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.lime))
  38. end
  39.  
  40. --Lava On
  41. function lavaOn()
  42. page4:flash("On")
  43. rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.yellow))
  44. end
  45.  
  46. --Lava Off
  47. function lavaOff()
  48. page4:flash("Off")
  49. rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.yellow))
  50. end
  51.  
  52. --Menus
  53. function mainTable()
  54. t = page1
  55. end
  56.  
  57. function redstoneTable()
  58. t = page2
  59. end
  60.  
  61. function enderTable()
  62. t = page3
  63. end
  64.  
  65. function lavaTable()
  66. t = page4
  67. end
  68.  
  69. --Layout Buttons
  70. do
  71. page1:add("Liquids Menu", doNothing, 1, 1, 36, 3, colors.purple, colors.purple, colors.white, colors.white)
  72. page1:add("Redstone", redstoneTable, 1, 5, 36, 6, colors.purple, colors.lime, colors.orange, colors.black)
  73. page1:add("Ender", enderTable, 1, 8, 36, 9, colors.purple, colors.lime, colors.red, colors.black)
  74. page1:add("Lava", lavaTable, 1, 11, 36, 12, colors.purple, colors.lime, colors.cyan, colors.black)
  75.  
  76. page2:add("Redstone Menu", doNothing, 1, 1, 36, 3, colors.orange, colors.orange, colors.black, colors.black)
  77. page2:add("On", rsOn, 4, 6, 10, 7, colors.orange, colors.lime, colors.black, colors.black)
  78. page2:add("Off", rsOff, 14, 6, 20, 7, colors.orange, colors.lime, colors.black, colors.black)
  79. page2:add("Back", mainTable, 24, 6, 30, 7, colors.orange, colors.lime, colors.black, colors.black)
  80.  
  81. page3:add("Ender Menu", doNothing, 1, 1, 36, 3, colors.red, colors.lime, colors.black, colors.black)
  82. page3:add("On", enOn, 1, 5, 36, 6, colors.red, colors.lime, colors.black, colors.black)
  83. page3:add("Off", enOff, 1, 8, 36, 9, colors.red, colors.lime, colors.black, colors.black)
  84. page3:add("Back", mainTable, 1, 11, 36, 12, colors.red, colors.lime, colors.black, colors.black)
  85.  
  86. page4:add("Lava Menu", doNothing, 1, 1, 36, 3, colors.cyan, colors.cyan, colors.black, colors.black)
  87. page4:add("On", lavaOpen, 1, 5, 36, 6, colors.cyan, colors.lime, colors.black, colors.black)
  88. page4:add("Off", lavaClose, 1, 7, 36, 9, colors.cyan, colors.lime, colors.black, colors.black)
  89. page4:add("Back", mainTable, 1, 14, 36, 15, colors.cyan, colors.lime, colors.black, colors.black)
  90.  
  91. end
  92.  
  93. --Begin Program
  94. mainTable()
  95.  
  96. while true do
  97. t:draw()
  98. local event, p1 = t:handleEvents(os.pullEvent())
  99. if event == "button_click" then
  100. t.buttonList[p1].func()
  101. end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment