Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("top")
- m.clear()
- function fillTable()
- button.setTable("Test", Test, 2, 10, 2, 2, colors.red)
- button.setTable("Test2", Test2, 2, 10, 4, 4, colors.yellow)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- redstone.setBundledOutput("right", 0)
- function setBundledColor(side, color, state)
- if state then
- if not colors.test(redstone.getBundledOutput(side), color) then
- redstone.setBundledOutput(side, colors.combine(redstones.getBundledOutput(side), color))
- end
- else
- if colors.test(redstones.getBundledOutput(side), color) then
- redstone.setBundledOutput(side, colors.subtract(redstone.getBundledOutput(side), color))
- end
- end
- end
- function toggleBundledColor(side, color)
- redstone.setBundledOutput(side, (colors.test(redstone.getBundledOutput(side), color) and colors.subtract(redstone.getBundledOutput(side), color) or colors.combine(redstone.getBundledOutput(side), color)))
- end
- function Test()
- button.toggleButton("Test")
- toggleBundledColor("right", colors.white)
- print("Test")
- end
- function Test2()
- button.toggleButton("Test2")
- toggleBundledColor("right", colors.yellow)
- print("Test2")
- end
- fillTable()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement