Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("touch")
- m = peripheral.wrap("top")
- m.clear()
- function AddOutput(sSide, ...)
- local c = colors.combine(rs.getBundledOutput(sSide), ...)
- rs.setBundledOutput(sSide, c)
- end
- function RemoveOutput(sSide, ...)
- local c = colors.subtract(rs.getBundledOutput(sSide), ...)
- rs.setBundledOutput(sSide, c)
- end
- function ToggleColor(sSide, color)
- if colors.test(rs.getBundledOutput(sSide), color) == true then
- RemoveOutput(sSide, color)
- else
- AddOutput(sSide, color)
- end
- end
- function fillTable()
- touch.setTable("test1", test1, 10, 20, 3, 5)
- touch.setTable("Quarry", quarry, 22, 32, 3 ,5)
- touch.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- touch.checkxy(x,y)
- end
- function test1()
- touch.toggleButton("test1")
- print("test1")
- ToggleColor("left", colors.white)
- end
- function quarry()
- touch.toggleButton("Quarry")
- ToggleColor("left", colors.orange)
- end
- fillTable()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement