Tomodachi94

MachineControl Updater/Installer

Jul 23rd, 2020 (edited)
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.36 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: Rolcam
  8. --Pastebin: cJkn6xuk
  9. --GitHub (report issues here): https://github.com/Tomodachi94/MachineControl/
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. term.setTextColor(colors.cyan)
  13. print("This is the MachineControl updater/installer.")
  14. print("Would you like to add built-in security to your MachineControl? (y/n)")
  15. security = read()
  16. if security == "y" then
  17. term.clear()
  18. term.setCursorPos(1,1)
  19. term.setTextColor(colors.yellow)
  20. print("This will override 2 files: \"startup\" and \"machinecontrol\", and reset the passwords to their defaults. Proceed? (y/n)")
  21. confirm = read()
  22. if confirm == "y" then
  23. term.clear()
  24. term.setCursorPos(1,1)
  25. term.setTextColor(colors.green)
  26. print("Installing security to startup...")
  27. shell.run("delete","startup")
  28. shell.run("pastebin get LhAt2bPW startup")
  29. print("Install success!")
  30. print("Installing MachineControl to MachineControl...")
  31. shell.run("delete", "machinecontrol")
  32. shell.run("pastebin", "get", "TfbP996B", "machinecontrol")
  33. term.setTextColor(colors.white)
  34. 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)")
  35. elseif confirm == "n" then
  36. term.clear()
  37. term.setCursorPos(1,1)
  38. term.setTextColor(colors.red)
  39. print("Installation cancelled. Rerun to start it again.")
  40. else
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. term.setTextColor(colors.red)
  44. print("Invalid input! Cancelling...")
  45. print("Rerun this program to start the installation again.")
  46. end
  47. elseif security == "n" then
  48. term.clear()
  49. term.setCursorPos(1,1)
  50. term.setTextColor(colors.yellow)
  51. print("This installer/updater will override 1 file: \"machinecontrol\". Proceed? (y/n)")
  52. confirm = read()
  53. if confirm == "y" then
  54. term.clear()
  55. term.setTextColor(colors.green)
  56. term.setCursorPos(1,1)
  57. print("Installing...")
  58. shell.run("delete","machinecontrol")
  59. shell.run("pastebin get TfbP996B machinecontrol")
  60. print("Install success!")
  61. elseif confirm == "n" then
  62. term.clear()
  63. term.setCursorPos(1,1)
  64. term.setTextColor(colors.red)
  65. print("Installation cancelled. Rerun the program to start it again.")
  66. end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment