Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Shutdown screen code with epic animation for ComputerCraft
- -- Function to clear the screen
- function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- -- Function to display an epic animation
- function displayEpicAnimation()
- clearScreen()
- local width, height = term.getSize()
- local message = "Shutting Down"
- local messageLength = #message
- local padding = math.floor((width - messageLength) / 2)
- for i = 1, height do
- for j = 1, padding do
- term.write(" ")
- end
- term.write(message)
- for j = 1, padding do
- term.write(" ")
- end
- sleep(0.1)
- clearScreen()
- end
- end
- -- Main function to initiate shutdown
- function shutdown()
- displayEpicAnimation()
- os.shutdown()
- end
- -- Call the shutdown function
- shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement