Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- initupdate.lua: Downloads the latest init.lua from Pastebin
- local function updateProgram(pastebinCode, programName)
- print("Starting update process for " .. programName .. "...")
- if fs.exists(programName) then
- print("Deleting old version of " .. programName .. "...")
- fs.delete(programName)
- if not fs.exists(programName) then
- print("Old version deleted successfully.")
- else
- error("Failed to delete old version of " .. programName)
- end
- else
- print("No old version of " .. programName .. " found.")
- end
- print("Downloading new version from Pastebin...")
- local success = shell.run("pastebin", "get", pastebinCode, programName)
- if success then
- print("Successfully downloaded " .. programName .. " from Pastebin.")
- print("Update complete! You can now run " .. programName .. ".")
- else
- error("Failed to download " .. programName .. " from Pastebin. Check the Pastebin code or internet connection.")
- end
- end
- -- Update init.lua
- local programName = "init.lua"
- local pastebinCode = "ypw1WRQa" -- Replace with actual Pastebin code
- updateProgram(pastebinCode, programName)
Advertisement
Advertisement