Advertisement
Ubidibity

initupdate.lua

Jun 17th, 2025 (edited)
301
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | Gaming | 1 0
  1. -- initupdate.lua: Downloads the latest init.lua from Pastebin
  2.  
  3. local function updateProgram(pastebinCode, programName)
  4.   print("Starting update process for " .. programName .. "...")
  5.   if fs.exists(programName) then
  6.     print("Deleting old version of " .. programName .. "...")
  7.     fs.delete(programName)
  8.     if not fs.exists(programName) then
  9.       print("Old version deleted successfully.")
  10.     else
  11.       error("Failed to delete old version of " .. programName)
  12.     end
  13.   else
  14.     print("No old version of " .. programName .. " found.")
  15.   end
  16.  
  17.   print("Downloading new version from Pastebin...")
  18.   local success = shell.run("pastebin", "get", pastebinCode, programName)
  19.   if success then
  20.     print("Successfully downloaded " .. programName .. " from Pastebin.")
  21.     print("Update complete! You can now run " .. programName .. ".")
  22.   else
  23.     error("Failed to download " .. programName .. " from Pastebin. Check the Pastebin code or internet connection.")
  24.   end
  25. end
  26.  
  27. -- Update init.lua
  28. local programName = "init.lua"
  29. local pastebinCode = "ypw1WRQa" -- Replace with actual Pastebin code
  30. updateProgram(pastebinCode, programName)
  31.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement