Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawCenteredText(y, text)
- local w, _ = term.getSize()
- local x = math.floor((w - #text) / 2)
- term.setCursorPos(x, y)
- term.write(text)
- end
- function drawShutdownScreen()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setTextColor(colors.white)
- local _, h = term.getSize()
- -- Draw Windows-like shutdown interface
- term.setBackgroundColor(colors.blue)
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- drawCenteredText(3, "Doggy OS")
- term.setCursorPos(1, h - 5)
- term.setTextColor(colors.lightGray)
- drawCenteredText(h - 4, "Shutting down...")
- term.setCursorPos(1, h - 3)
- drawCenteredText(h - 2, "Thank you for using Doggy OS!")
- os.sleep(3) -- Display the shutdown screen for 3 seconds
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setTextColor(colors.white)
- drawCenteredText(math.floor(h / 2), "Goodbye!")
- os.sleep(2) -- Pause for 2 seconds before shutting down
- os.shutdown()
- end
- -- Main script execution starts here
- drawShutdownScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement