Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- monX, monY = mon.getSize()
- mon.setTextScale(1)
- if mon.isColor() then
- colorPos = colors.green
- colorNeg = colors.red
- else
- colorPos = colors.white
- colorNeg = colors.white
- end
- SENSORDIR = "back"
- while true do
- mon.setBackgroundColor(colors.black)
- mon.clear()
- o2pos = redstone.getInput(SENSORDIR)
- function get02()
- if o2pos then
- text = "%POS%"
- mon.setBackgroundColor(colorPos)
- redstone.setOutput("bottom", true)
- else
- text = "*NEG*"
- mon.setBackgroundColor(colorNeg)
- redstone.setOutput("bottom", false)
- end
- end
- get02()
- posX = math.ceil((monX / 2) - (#text / 2)) + 1
- posY = monY / 2 + 1
- mon.setBackgroundColor(colors.blue)
- mon.setCursorPos(monX / 2, monY / 2 - 1)
- mon.write("02:")
- get02()
- mon.setCursorPos(posX, posY)
- mon.write(text)
- time = os.startTimer(2)
- event = os.pullEvent()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement