Advertisement
DOGGYWOOF

Untitled

Jul 12th, 2024 (edited)
2
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. -- Function to prompt user to remove disk and continue
  2. local function waitForDiskRemoval()
  3. print("Please remove the disk and press Enter to continue.")
  4. io.read() -- Wait for user to press Enter
  5. end
  6.  
  7. -- Prompt the user to insert the first disk
  8. print("Please insert the first disk and press Enter.")
  9. io.read()
  10.  
  11. -- Check if the disk is inserted
  12. if not fs.exists("/disk") or not fs.isDir("/disk") then
  13. print("Error: Disk not found or not mounted properly.")
  14. return
  15. end
  16.  
  17. -- Copy the contents of the disk to /temp/
  18. if not fs.exists("/temp") then
  19. fs.makeDir("/temp")
  20. end
  21. for _, file in ipairs(fs.list("/disk")) do
  22. fs.copy("/disk/" .. file, "/temp/" .. file)
  23. end
  24.  
  25. -- Prompt the user to remove the first disk
  26. print("Please remove the first disk.")
  27.  
  28. waitForDiskRemoval() -- Wait for user to remove the disk
  29.  
  30. -- Prompt the user to insert the second disk
  31. print("Please insert the second disk and press Enter.")
  32. io.read()
  33.  
  34. -- Check if the disk is inserted
  35. if not fs.exists("/disk2") or not fs.isDir("/disk2") then
  36. print("Error: Second disk not found or not mounted properly.")
  37. return
  38. end
  39.  
  40. -- Copy the contents of /temp/ to /disk2/
  41. for _, file in ipairs(fs.list("/temp")) do
  42. fs.copy("/temp/" .. file, "/disk2/" .. file)
  43. end
  44.  
  45. -- Delete /temp/ folder
  46. fs.delete("/temp")
  47.  
  48. -- Create the startup file on /disk2/
  49. local startupContent = [[
  50. shell.run("/disk/boot/error")
  51. shell.run("/disk/boot/startup")
  52. shell.run("/disk/boot/startup.lua")
  53. ]]
  54. local startupFile = fs.open("/disk2/startup", "w")
  55. startupFile.write(startupContent)
  56. startupFile.close()
  57.  
  58. -- Notify the user and prompt for reboot
  59. print("Setup completed. Please reboot the computer.")
  60.  
  61. -- Reboot the computer
  62. os.reboot()
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement