Advertisement
rithrin

lock startup

Oct 3rd, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. print("---------------Welcome!----------------")
  2. print("---------Dark lock installer!----------")
  3. print("---------------------------------------")
  4. print("This will install Dark lock 1.4 to your")
  5. print("---------Minecraft Computer------------")
  6. print("")
  7. print(" 1. Install Dark lock")
  8. print(" 2. Exit ")
  9. print("---------------------------------------")
  10. print(" Warning! Dark lock will overide ")
  11. print(" Your default startup program")
  12. print("")
  13. write("type a number then press enter: ")
  14. user=io.read()
  15.  
  16. function makeprogram()
  17. term.clear() term.setCursorPos(1,1)
  18. print("Looking for old startup file...")
  19. sleep(1)
  20. if fs.exists("startup") == true then
  21. shell.run("rm", "startup")
  22. print("Startup file found, deleting...")
  23. sleep(1)
  24. end
  25. if fs.exists("setup") == true then
  26. shell.run("rm", "setup")
  27. end
  28. if fs.exists("lock/conf") == true then
  29. shell.run("rm", "lock/conf")
  30. end
  31. if fs.exists("lock/attempt") == true then
  32. shell.run("rm", "lock/attempt")
  33. end
  34.  
  35. sleep(1)
  36.  
  37. print("Making new directory...")
  38. shell.run("mkdir", "lock")
  39. sleep(2)
  40.  
  41. print("Copying Files...")
  42. print("")
  43. sleep(1)
  44.  
  45. file = io.open("lock/attempt","w")
  46. file:write("")
  47. file:close()
  48.  
  49. file = io.open("lock/conf","w")
  50. file:write("")
  51. file:close()
  52.  
  53. shell.run("cp", "disk/lock", "/startup")
  54. if fs.exists("startup") == true then
  55. print ("Startup copy... Success")
  56. else
  57. print ("Startup copy... Failed")
  58. end
  59.  
  60. sleep(1)
  61. print("")
  62.  
  63. shell.run("cp", "disk/setup", "/")
  64. if fs.exists("setup") == true then
  65. print ("setup copy... Success")
  66. else
  67. print ("setup copy... Failed")
  68. end
  69.  
  70. sleep(1)
  71. print("")
  72. print("Install completed")
  73. sleep(1)
  74. print("")
  75. print("now running setup")
  76. sleep(2)
  77.  
  78. shell.run("setup")
  79. end
  80.  
  81. --running program
  82.  
  83. if user=="1" then
  84. term.clear() term.setCursorPos(1,1)
  85. print("Running install...")
  86. sleep(2)
  87. makeprogram()
  88. end
  89. if not(user=="1") then
  90. term.clear() term.setCursorPos(1,1)
  91. print("Exiting...")
  92. sleep(2)
  93. term.clear() term.setCursorPos(1,1)
  94. shell.run("startup")
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement