SHOW:
|
|
- or go back to the newest paste.
| 1 | local monX, monY = term.getSize() | |
| 2 | ||
| 3 | local function drawUI(sStepNumber, sText) | |
| 4 | term.clear() | |
| 5 | term.setBackgroundColor(colors.black) | |
| 6 | ||
| 7 | paintutils.drawLine(1, 1, monX, 1, colors.white) | |
| 8 | ||
| 9 | term.setTextColor(colors.black) | |
| 10 | term.setCursorPos(1, 1) | |
| 11 | - | term.write("arc13's Backup Utility")
|
| 11 | + | term.write("arc13's Restore Utility")
|
| 12 | ||
| 13 | term.setBackgroundColor(colors.black) | |
| 14 | ||
| 15 | term.setTextColor(colors.white) | |
| 16 | term.setCursorPos(1, 3) | |
| 17 | term.write("Step "..sStepNumber)
| |
| 18 | ||
| 19 | term.setCursorPos(1, 4) | |
| 20 | ||
| 21 | for i = 1, monX do | |
| 22 | write(string.char(131)) | |
| 23 | end | |
| 24 | ||
| 25 | term.setCursorPos(1, 5) | |
| 26 | print(sText) | |
| 27 | end | |
| 28 | ||
| 29 | - | drawUI("1", "Welcome to the arc13's Backup Utility.\n\nThis wizard will guide you through this utility.\n\nIt is recommended that you eject all disks that may be connected to this computer.\n\nPress any key to continue.")
|
| 29 | + | drawUI("1", "Welcome to the arc13's Restore Utility.\n\nThis wizard will guide you through this utility.\n\nIt is recommended that you eject all disks that may be connected to this computer.\n\nPress any key to continue.")
|
| 30 | os.pullEvent("key")
| |
| 31 | ||
| 32 | - | drawUI("2", "The wizard will now run the backup utility.\n\nPress any key to continue.\n\n")
|
| 32 | + | drawUI("2", "Please sure that the backuped file \"files.bkp\" is on the directory \"/\".\n\nPress any key to continue.")
|
| 33 | os.pullEvent("key")
| |
| 34 | ||
| 35 | - | shell.run("pastebin run 20CdUw4b")
|
| 35 | + | if not fs.exists("/files.bkp") then
|
| 36 | error("File not found : \"/files.bkp\"", 0)
| |
| 37 | - | drawUI("3", "The backup is done.\n\nYou should have a file called \"files.bkp\" in the \"/\" directory, please do a \"pastebin put files.bkp\" after this program finish.\n\nPress any key to continue.")
|
| 37 | + | |
| 38 | ||
| 39 | drawUI("3", "The wizard will now run the restore utility.\n\nPress any key to continue.\n\n")
| |
| 40 | - | drawUI("4", "The backup utility wizard is now finished.\n\nThanks for using me!\n\nPress any key to finish.")
|
| 40 | + | |
| 41 | ||
| 42 | shell.run("pastebin run qryd43n6")
| |
| 43 | ||
| 44 | - | term.setCursorPos(1, 1) |
| 44 | + | drawUI("4", "The restore is done.\n\nYou should have all your files from your old computer.\n\nPress any key to continue.")
|
| 45 | - | print("Don't forget to upload to pastebin the \"files.bkp\" file by using \"pastebin put files.bkp\".\n") |
| 45 | + | |
| 46 | ||
| 47 | drawUI("5", "The restore utility wizard is now finished.\n\nThanks for using me!\n\nPress any key to finish.")
| |
| 48 | os.pullEvent("key")
| |
| 49 | ||
| 50 | term.clear() | |
| 51 | term.setCursorPos(1, 1) |