Posted 12 September 2012 - 11:03 PM
term.clear()
sleep(0)
term.setCursorPos(1,1)
event, p1 = os.pullEvent("key")
print("Press ESC to shutdown")
print("Press any other key to go back to normal")
if p1 == 1 then
write("Shutting Down")
sleep(1)
write(".")
sleep(1)
write(".")
sleep(1)
write(".")
sleep(1)
os.shutdown()
else
print("Returning to normal")
write("14%")
sleep(1)
term.setCursorPos(1,3)
write("34%")
sleep(1)
term.setCursorPos(1,3)
write("57%")
sleep(1)
term.setCursorPos(1,3)
write("78%")
sleep(1)
term.setCursorPos(1,3)
write("97%")
sleep(1)
term.setCursorPos(1,3)
print("Done!")
sleep(2)
term.clear()
sleep(0)
term.setCursorPos(1,1)
shell.run("startup")
end
I made an improved exit program, but there is a weird bug where when I run the program it doesn't show the text till I press one of the keys.