Posted 20 September 2012 - 04:50 PM
This is a PURELY Aesthetic Exit program that I designed for a Home Computer System within ComputerCraft.
For this to work I suggest that your "Main Menu" contain several programs so when you exit one of those programs, you have a place to go back to.
First, find the program you want to add the "Exit" option to.
Then add this code to it's ending:
3rd, Create a file named "Exit" by typing into your terminal "edit Exit"
Then type this into your exit file…plz be sure to read the comments throughout this…they contain helpful info and more setup.
Please bear in mind, your menu program might need the code to erase the screen before it starts:
Thank You for viewing, any comments/bugs/fixes you can place in the comment section below.
This code hasn't been tested yet, why don't you be the first?
For this to work I suggest that your "Main Menu" contain several programs so when you exit one of those programs, you have a place to go back to.
First, find the program you want to add the "Exit" option to.
Then add this code to it's ending:
print("Type 'Exit' to Return To The Menu")
shell.run("Exit") --Runs your *New* Exit program
3rd, Create a file named "Exit" by typing into your terminal "edit Exit"
Then type this into your exit file…plz be sure to read the comments throughout this…they contain helpful info and more setup.
term.clear()
term.setCursorPos(1,1)
print("Exiting to Menu")
sleep(1)
term.setCursorPos(16,1)
print(".")
sleep(1)
term.setCursorPos(17,1)
print(".")
sleep(1)
term.setCursorPos(18,1)
print(".")
sleep(3)
shell.run("startup") --The name ofyour menu program
Please bear in mind, your menu program might need the code to erase the screen before it starts:
term.clear()
term.setCursorPos(1,1)
Thank You for viewing, any comments/bugs/fixes you can place in the comment section below.
This code hasn't been tested yet, why don't you be the first?