Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local redstoneout = "back"
- local monitor = "top"
- local mon = peripheral.wrap(monitor)
- local redstone = 0
- rs.setAnalogOutput(redstoneout, 0)
- print("Program by Matrix89")
- while true do
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- mon.setCursorPos(1,3)
- mon.setBackgroundColor(colors.yellow)
- mon.write("+")
- mon.setCursorPos(7,3)
- mon.write("-")
- mon.setCursorPos(3,4)
- mon.setBackgroundColor(colors.blue)
- mon.write(redstone)
- mon.setCursorPos(1,5)
- mon.setBackgroundColor(colors.red)
- mon.write("Set 0 ")
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(colors.green)
- mon.write("Set 15 ")
- local event, side ,xPos ,yPos = os.pullEvent("monitor_touch")
- if yPos == 3 then
- if xPos == 1 then
- redstone = redstone + 1
- end
- if xPos == 7 then
- redstone = redstone - 1
- end
- end
- if yPos == 5 then
- redstone = 0
- end
- if yPos == 1 then
- redstone = 15
- end
- if redstone == -1 then
- redstone = 0
- end
- if redstone == 16 then
- redstone = 15
- end
- sleep(0.1)
- rs.setAnalogOutput(redstoneout, redstone)
- end
Advertisement
Add Comment
Please, Sign In to add comment