Advertisement
YukkuriAinekoka

ComputerCraft_1.75_SPMC

Feb 22nd, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. function dl(fn,sn)
  2.     if http then
  3.         local sPath = shell.resolve(sn)
  4.  
  5.         local response = http.get("http://yukkuridownloader.net/cc/"..fn)
  6.         if response then
  7.             local res = response.readAll()
  8.             response.close()
  9.             local file = fs.open( sPath, "w" )
  10.             file.write( res )
  11.             file.close()
  12.             return "OK",res
  13.         else
  14.             return "ERROR"
  15.         end
  16.     else
  17.         return "ERROR"
  18.     end
  19. end
  20.  
  21. shell.setDir( "/" )
  22. if fs.exists("spms")==false then
  23.     fs.makeDir("spms")
  24.     shell.setDir( "spms" )
  25.     if dl("ver","now_ver")=="OK" then
  26.         dl("ud","ud")
  27.         shell.setDir( "/" )
  28.         dl("spm","spm")
  29.         dl("startup","startup")
  30.         print("SPM installation completed")
  31.     else
  32.         printError("Installation failed.")
  33.     end
  34. else
  35.     print("SPM is already installed.")
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement