Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("left")
- local tick = 0
- local msgId = 0
- function writeMsg()
- msg = "unkown"
- x = 0
- if msgId == 101 then msg = "Initialization..." x = 18
- elseif msgId == 102 then msg = "Terminate request" x = 18
- elseif msgId == 301 then msg = "No network connection" x = 17
- elseif msgId == 302 then msg = "Terminated" x = 21 end
- monitor.setCursorPos(x, 10)
- monitor.write(msg)
- end
- function redraw()
- tick = tick + 1
- monitor.clear()
- monitor.setCursorPos(20, 4)
- monitor.setTextScale(1)
- monitor.setTextColor(colors.white)
- monitor.write("ShE3py's Home")
- if msgId ~= 0 then
- oldColor = monitor.getTextColor()
- if msgId < 200 then monitor.setTextColor(colors.lightBlue)
- elseif msgId < 300 then monitor.setTextColor(colors.orange)
- elseif msgId < 400 then monitor.setTextColor(colors.red) end
- if msgId < 200 then writeMsg()
- elseif tick % 2 == 0 then writeMsg() end
- monitor.setTextColor(oldColor)
- end
- end
- function setMsgId(id)
- msgId = id
- redraw()
- end
- function getMsgId()
- return msId
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement