Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("touchpoint")
- --Set Up Pages
- local page1 = touchpoint.new("monitor_")
- local page2 = touchpoint.new("monitor_")
- local page3 = touchpoint.new("monitor_")
- local page4 = touchpoint.new("monitor_")
- --Functions
- --Ignores Input
- function doNothing()
- sleep(0.5)
- end
- --Redstone On
- function rsOn()
- page2:flash("On")
- rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.lightBlue))
- end
- --Redstone Off
- function rsOff()
- page2:flash("Off")
- rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.lightBlue))
- end
- --Ender On
- function enOn()
- page3:flash("On")
- rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.lime))
- end
- --Ender Off
- function enOff()
- page3:flash("Off")
- rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.lime))
- end
- --Lava On
- function lavaOn()
- page4:flash("On")
- rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.yellow))
- end
- --Lava Off
- function lavaOff()
- page4:flash("Off")
- rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.yellow))
- end
- --Menus
- function mainTable()
- t = page1
- end
- function redstoneTable()
- t = page2
- end
- function enderTable()
- t = page3
- end
- function lavaTable()
- t = page4
- end
- --Layout Buttons
- do
- page1:add("Liquids Menu", doNothing, 1, 1, 36, 3, colors.purple, colors.purple, colors.white, colors.white)
- page1:add("Redstone", redstoneTable, 1, 5, 36, 6, colors.purple, colors.lime, colors.orange, colors.black)
- page1:add("Ender", enderTable, 1, 8, 36, 9, colors.purple, colors.lime, colors.red, colors.black)
- page1:add("Lava", lavaTable, 1, 11, 36, 12, colors.purple, colors.lime, colors.cyan, colors.black)
- page2:add("Redstone Menu", doNothing, 1, 1, 36, 3, colors.orange, colors.orange, colors.black, colors.black)
- page2:add("On", rsOn, 4, 6, 10, 7, colors.orange, colors.lime, colors.black, colors.black)
- page2:add("Off", rsOff, 14, 6, 20, 7, colors.orange, colors.lime, colors.black, colors.black)
- page2:add("Back", mainTable, 24, 6, 30, 7, colors.orange, colors.lime, colors.black, colors.black)
- page3:add("Ender Menu", doNothing, 1, 1, 36, 3, colors.red, colors.lime, colors.black, colors.black)
- page3:add("On", enOn, 1, 5, 36, 6, colors.red, colors.lime, colors.black, colors.black)
- page3:add("Off", enOff, 1, 8, 36, 9, colors.red, colors.lime, colors.black, colors.black)
- page3:add("Back", mainTable, 1, 11, 36, 12, colors.red, colors.lime, colors.black, colors.black)
- page4:add("Lava Menu", doNothing, 1, 1, 36, 3, colors.cyan, colors.cyan, colors.black, colors.black)
- page4:add("On", lavaOpen, 1, 5, 36, 6, colors.cyan, colors.lime, colors.black, colors.black)
- page4:add("Off", lavaClose, 1, 7, 36, 9, colors.cyan, colors.lime, colors.black, colors.black)
- page4:add("Back", mainTable, 1, 14, 36, 15, colors.cyan, colors.lime, colors.black, colors.black)
- end
- --Begin Program
- mainTable()
- while true do
- t:draw()
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t.buttonList[p1].func()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment