Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Clear the screen and set up colors
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- -- Define the width and height of the screen
- local width, height = term.getSize()
- -- Helper function to center text on the screen
- local function centerText(y, text, textColor)
- local x = math.floor((width - #text) / 2)
- term.setCursorPos(x, y)
- term.setTextColor(textColor)
- term.write(text)
- end
- -- Define the dog ASCII art with white color and @ for eyes
- local dogArt = {
- " |\\_/| ",
- " | @ @ ",
- " | <> _ ",
- " | _/\\------____ ((| |))",
- " | `--' | ",
- " _____|_ ___| |___. ",
- "/_/_____/____/_______| "
- }
- local startLine = math.floor((height - #dogArt) / 2) - 2
- -- Display the dog ASCII art with white color
- term.setTextColor(colors.white)
- for i, line in ipairs(dogArt) do
- centerText(startLine + i, line, colors.white)
- end
- -- Display the "Insert Disk" message in white
- centerText(startLine + #dogArt + 2, "Insert Disk", colors.white)
- -- Continuously check for /disk/boot/start-check.lua and run it if found
- while true do
- if fs.exists("/disk/boot/start-check.lua") and not fs.isDir("/disk/boot/start-check.lua") then
- -- Run the script using shell.run
- shell.run("/disk/boot/start-check.lua")
- break -- Exit the loop after running the script
- end
- sleep(1) -- Wait for a while before checking again
- end
- -- Check if /disk2/ exists before proceeding with the installation script
- if fs.exists("/disk2") and fs.isDir("/disk2") then
- -- Perform the disk operations
- fs.copy("update-backup")
- fs.delete("/disk")
- sleep(3)
- fs.copy("/disk2/","/root")
- disk.eject("top")
- disk.eject("bottom")
- disk.eject("left")
- disk.eject("right")
- sleep(3)
- term.clear()
- term.setCursorPos(1,1)
- sleep(3)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("rename","/root","/disk")
- fs.copy("/disk/","recovery")
- print(2)
- fs.delete(".settings")
- fs.copy("/disk/.settings",".settings")
- sleep(2)
- shell.run("/disk/install-assist")
- else
- -- Display a message if /disk2/ is not found
- term.setTextColor(colors.red)
- print("error")
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement