Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("top")
- m.clear()
- local btn = "TOGGLE BRIDGE"
- function fillTable()
- button.setTable(btn, bridge, "", 1, 18, 1, 5)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function setOutput(arg)
- if arg then
- print("Opening bridge...")
- else
- print("Closing bridge...")
- end
- redstone.setOutput("left", arg)
- end
- function bridge(arg)
- button.toggleButton(btn)
- setOutput(button.button[btn]["active"])
- end
- redstone.getSides()
- fillTable()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment