Rolcam

Tomodachi94's MachineControl Updater (Outdated)

Jul 19th, 2020 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.55 KB | None | 0 0
  1. --MachineControlUpdate by Tomodachi94
  2. --Feel free to use this for commerical and non-commercial use
  3. --If you modify it, please give credit.
  4. --MachineControl Pastebin: https://pastebin.com/TfbP996B
  5. --Lock program Pastebin: https://pastebin.com/LhAt2bPW
  6. --Last modified: 7/19/2020
  7. --By: Tomodachi94
  8. --Fixed/Updated by: Rolcam
  9. --Pastebin: (HhBB9Grg - Rolcam)
  10. --GitHub (report issues here): https://github.com/Tomodachi94/MachineControl/
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. term.setTextColor(colors.cyan)
  14. print("This is the MachineControl updater/installer.")
  15. print("Would you like to add built-in security to your MachineControl? (y/n)")
  16. security = read()
  17. if security == "y" then
  18.   term.clear()
  19.   term.setCursorPos(1,1)
  20.   term.setTextColor(colors.yellow)
  21.   print("This will override 2 files: \"startup\" and \"machinecontrol\", and reset the passwords to their defaults. Proceed? (y/n)")
  22.   confirm = read()
  23.   if confirm == "y" then
  24.     term.clear()
  25.     term.setCursorPos(1,1)
  26.     term.setTextColor(colors.green)
  27.     print("Installing security to startup...")
  28.     shell.run("delete","startup")
  29.     shell.run("pastebin get LhAt2bPW startup")
  30.     print("Install success!")
  31.     print("Installing MachineControl to MachineControl...")
  32.     shell.run("delete", "machinecontrol")
  33.     shell.run("pastebin", "get", "TfbP996B", "machinecontrol")
  34.     term.setTextColor(colors.white)
  35.     print("You will now need to edit startup, and change the password. Then, run reboot and the program should work as expected.(Report errors at GitHub)")
  36.   elseif confirm == "n" then
  37.     term.clear()
  38.     term.setCursorPos(1,1)
  39.     term.setTextColor(colors.red)
  40.     print("Installation cancelled. Rerun to start it again.")
  41.   else
  42.     term.clear()
  43.     term.setCursorPos(1,1)
  44.     term.setTextColor(colors.red)
  45.     print("Invalid input! Cancelling...")
  46.     print("Rerun this program to start the installation again.")
  47.   end
  48. elseif security == "n" then
  49.   term.clear()
  50.   term.setCursorPos(1,1)
  51.   term.setTextColor(colors.yellow)
  52.   print("This installer/updater will override 1 file: \"machinecontrol\". Proceed? (y/n)")
  53.   confirm = read()
  54.   if confirm == "y" then
  55.     term.clear()
  56.     term.setTextColor(colors.green)
  57.     term.setCursorPos(1,1)
  58.     print("Installing...")
  59.     shell.run("delete","machinecontrol")
  60.     shell.run("pastebin get TfbP996B machinecontrol")
  61.     print("Install success!")
  62.   elseif confirm == "n" then
  63.     term.clear()
  64.     term.setCursorPos(1,1)
  65.     term.setTextColor(colors.red)
  66.     print("Installation cancelled. Rerun the program to start it again.")
  67.   end
  68. end
Add Comment
Please, Sign In to add comment