Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- modem = peripheral.wrap("right")
- modem.open(100)
- sleepTime = 10
- warning = 10
- while true do
- event, side, frequency, replyFrequency, percentfull, distance = os.pullEvent("modem_message")
- print("Message is as follows: "..percentfull)
- mon.clear()
- mon.setCursorPos(3,3)
- if percentfull < warning then
- mon.setTextColour(colours.red)
- elseif percentfull > 90 then
- mon.setTextColour(colours.green)
- end
- mon.write(percentfull.."%")
- print(percentfull.."%")
- sleep(sleepTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement