Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to handle redstone signal at the start
- local function checkRedstoneSignal()
- if redstone.getInput("right") then
- shell.run(".emgrec/bootloader")
- return true -- Indicates that the emergency bootloader was executed
- end
- return false -- Indicates no signal was detected
- end
- -- List of required files
- local requiredFiles = {
- "/disk/bootloader/VA11-ILLA.lua",
- "/disk/os/home.lua",
- "/disk/os/lock.lua",
- "/disk/boot/boot-animation",
- "/disk/error/BSOD.lua",
- -- Add more file names as needed
- }
- -- Function to check if all required files exist
- os.pullEvent = os.pullEventRaw
- local function checkFiles()
- local missingFiles = {}
- for _, fileName in ipairs(requiredFiles) do
- if not fs.exists(fileName) then
- table.insert(missingFiles, fileName)
- end
- end
- return missingFiles
- end
- -- Main function to execute no-os.lua if files are missing
- local function main()
- local missing = checkFiles()
- if #missing > 0 then
- -- Execute no-os.lua if any files are missing
- shell.run("no-os")
- else
- -- All files exist, continue with your code here
- shell.run("/disk/boot/start-check.lua")
- -- Add your code to run if all files exist
- end
- end
- -- Check for redstone signal at the very start
- if checkRedstoneSignal() then
- return -- Exit immediately if the emergency bootloader was executed
- end
- -- Run the main function if no redstone signal was detected
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement