Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("Button")
- m = peripheral.wrap("right")
- m.clear()
- function fillTable()
- Button.setTable("LightsOn", LightsOnFunc, 10,20,3,8)
- Button.setTable("LightsOff", LightsOffFunc, 30,40,3,8)
- Button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- Button.checkxy(x,y)
- end
- function LightsOnFunc()
- rs.setOutput("left", false)
- button.toggleButton("LightsOn")
- print("LightsOn")
- end
- function LightsOffFunc()
- rs.setOutput("left", true)
- button.toggleButton("LightsOff")
- print("LightsOff")
- end
- fillTable()
- Button.heading("SpaceShipControl")
- Button.label(4,5,"Lights")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment