Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("bottom")
- m = peripheral.wrap("top")
- m.clear()
- m.setTextScale(1.5)
- width, height = m.getSize()
- departingTime = 0
- untilDecrement = 0
- timer = os.startTimer(0.05)
- while true do
- event = {os.pullEvent()}
- if event[1] == "timer" then
- m.clear()
- if departingTime > 0 then
- if untilDecrement <= 0 then
- departingTime = departingTime - 1
- untilDecrement = 20
- else
- untilDecrement = untilDecrement - 1
- end
- end
- displayText = "Departing in:"
- m.setCursorPos(math.floor((width-#displayText)/2), (height/2)-1)
- m.write(displayText)
- displayText = departingTime.." seconds"
- m.setCursorPos(math.ceil((width-#displayText)/2), (height/2)+1)
- m.write(displayText)
- timer = os.startTimer(0.05)
- elseif event[1] == "rednet_message" then
- departingTime = tonumber(event[3]) or 0
- untilDecrement = 20
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment