Advertisement
DOGGYWOOF

Untitled

Dec 9th, 2024
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 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 to execute no-os.lua if files are missing
  27. local function main()
  28. local missing = checkFiles()
  29.  
  30. -- Check if neither /recovery nor /disk exists
  31. if not fs.exists("/recovery") and not fs.exists("/disk") then
  32. shell.run("RCkey_noOS")
  33. else
  34. if #missing > 0 then
  35. -- Execute no-os.lua if any files are missing
  36. shell.run("no-os")
  37. else
  38. -- All files exist, continue with your code here
  39. if fs.exists("recoverylock.cfg") then
  40. shell.run("RCkey")
  41. else
  42. shell.run("/disk/boot/start-check.lua")
  43. end
  44. end
  45. end
  46. end
  47.  
  48. -- Run the main function
  49. main()
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement