joshuaferr1s

startup.lua

Jun 8th, 2021 (edited)
965
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.   JoshCorp's AutoUpdater
  3. ]]--
  4.  
  5. local function save(table, name)
  6.   local file = fs.open(name, "w")
  7.   file.write(textutils.serialize(table))
  8.   file.close()
  9. end
  10.    
  11. local function load(name)
  12.   local file = fs.open(name, "r")
  13.   local data = file.readAll()
  14.   file.close()
  15.   return textutils.unserialize(data)
  16. end
  17.  
  18. fs.delete("config/programs")
  19. shell.run("pastebin get ZqgY5NWN config/programs")
  20.  
  21. local programs = load("config/programs")
  22.  
  23. for k, v in pairs(programs) do
  24.   fs.delete(k)
  25.   shell.run("pastebin get "..v.." "..k)
  26. end
  27.  
RAW Paste Data