Arc13

Restore Utility UI

Nov 5th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 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 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", "Please sure that the backuped file \"files.bkp\" is on the directory \"/\".\n\nPress any key to continue.")
  33. os.pullEvent("key")
  34.  
  35. if not fs.exists("/files.bkp") then
  36.   error("File not found : \"/files.bkp\"", 0)
  37. end
  38.  
  39. drawUI("3", "The wizard will now run the restore utility.\n\nPress any key to continue.\n\n")
  40. os.pullEvent("key")
  41.  
  42. shell.run("pastebin run qryd43n6")
  43.  
  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. os.pullEvent("key")
  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)
Add Comment
Please, Sign In to add comment