SHARE
TWEET

SimSoft 4 - SystemUpdate

Simlor_GER Jul 6th, 2016 (edited) 1,480 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Copyright Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/) -  Alle Rechte an diesen Programm sind Simlor vorbehalten.
  2.  
  3.  
  4. BC(256)
  5. Clear()
  6.  
  7. SimSoftBalken("SimSoft 4 - OS-Update", 21)
  8.  
  9. TC(1)
  10. BC(256)
  11. CP(4,5)
  12. print("Update System")
  13.  
  14. TC(128)
  15.  
  16. --Version des eigenen OS
  17. CP(2,7)
  18.  
  19. VerSpr()
  20.  
  21. print("Clint os version: "..SS2V)
  22.  
  23. --Update Datei wird geladen
  24. CP(2,8)
  25. print("Load Update Details")
  26.  
  27. local datei = http.get("http://pastebin.com/raw/5dPkiCxH")
  28. datei = datei.readAll()
  29.  
  30. local file = fs.open("SimSoft/Data/UpdateCheck/S","w")
  31. file.writeLine(datei)
  32. file.close()
  33.  
  34. CP(2,9)
  35. TC(128)
  36.  
  37. file = fs.open("SimSoft/Data/UpdateCheck/S","r")
  38. local fileData = {}
  39. local line = file.readLine()
  40. repeat
  41. table.insert(fileData,line)
  42. line = file.readLine()
  43. until line == nil
  44. file.close()
  45.  
  46. v = fileData[1]
  47.  
  48. if v == SS2V then
  49.  print("The latest version is already")
  50.  CP(2,10)
  51.  print("installed")
  52.  TC(1)
  53.  CP(2,11)
  54.  print("Please wait...")
  55.  sleep(4)
  56.  fs.delete("SimSoft/Data/UpdateCheck/S")
  57.  print(" System reboot...")
  58.  sleep(0.2)
  59.  os.reboot()
  60. else
  61.  print("Update available...")
  62.  sleep(2)
  63.  BC(32768)
  64.  TC(1)
  65.  Clear()
  66.  print("SimSoft Update BOX")
  67.  
  68.  a = 1
  69.  
  70.  while true do
  71.   a = (a+3)
  72.   v = fileData[a]
  73.  
  74.   if v == SS2V then
  75.    break
  76.   end
  77.  end
  78.  
  79.  a = (a+1)
  80.  l = fileData[a]
  81.  
  82.  local datei = http.get("http://pastebin.com/raw/"..l)
  83.  datei = datei.readAll()
  84.  
  85.  local file = fs.open("SimSoft/Data/UpdateCheck/version","w")
  86.  file.writeLine(datei)
  87.  file.close()
  88.  
  89.  shell.run("SimSoft/Data/UpdateCheck/version")
  90.  
  91.  fs.delete("SimSoft/Data/UpdateCheck/S")
  92.  print("System reboot...")
  93.  sleep(0.2)
  94.  os.reboot()
  95. end
  96.  
  97. --End
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top