Advertisement
DOGGYWOOF

Untitled

Dec 9th, 2024
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. -- List of required files
  2. local requiredFiles = {
  3. "/disk/bootloader/VA11-ILLA.lua",
  4. "/disk/os/home.lua",
  5. "/disk/os/lock.lua",
  6. "/disk/boot/boot-animation",
  7. "/disk/error/BSOD.lua",
  8. -- Add more file names as needed
  9. }
  10.  
  11. -- Function to check if all required files exist
  12. os.pullEvent = os.pullEventRaw
  13.  
  14. local function checkFiles()
  15. local missingFiles = {}
  16.  
  17. for _, fileName in ipairs(requiredFiles) do
  18. if not fs.exists(fileName) then
  19. table.insert(missingFiles, fileName)
  20. end
  21. end
  22.  
  23. return missingFiles
  24. end
  25.  
  26. -- Main function
  27. local function main()
  28. -- Check if recoverylock.cfg exists
  29. if fs.exists("/disk/recoverylock.cfg") then
  30. shell.run("RCkey")
  31. return -- Exit if RCkey is executed
  32. end
  33.  
  34. -- Check for missing files
  35. local missing = checkFiles()
  36.  
  37. if #missing > 0 then
  38. -- Execute no-os.lua if any files are missing
  39. shell.run("no-os")
  40. else
  41. -- All files exist, continue with your code here
  42. shell.run("/disk/boot/start-check.lua")
  43. -- Add your code to run if all files exist
  44. end
  45. end
  46.  
  47. -- Run the main function
  48. main()
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement