Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- monX, monY = mon.getSize()
- redstone.setOutput("right", true)
- mon.setTextScale(1)
- while true do
- mon.setBackgroundColor(colors.black)
- mon.clear()
- monX, monY = mon.getSize()
- o2 = redstone.getInput("bottom")
- posX = monX / 2 - 1
- posY = 1
- mon.setCursorPos(posX, posY)
- if o2 then
- mon.setBackgroundColor(colors.green)
- mon.write("%POS%")
- else
- mon.setBackgroundColor(colors.red)
- mon.write("*NEG*")
- end
- posY = math.ceil(monY / 2)
- mon.setCursorPos(posX, posY)
- if redstone.getOutput("right") then
- mon.setBackgroundColor(colors.green)
- else
- mon.setBackgroundColor(colors.red)
- end
- mon.write("Enter")
- timer = os.startTimer(5)
- event = {os.pullEvent()}
- if event[1] == "monitor_touch" then
- if event[3] >= posX and event[3] <= posX + 5 and event[4] == posY then
- redstone.setOutput("right", not redstone.getOutput("right"))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement