SHARE
TWEET

SimSoft Yellow (english) - Update

Simlor_GER Jun 11th, 2017 (edited) 2,113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --SimSoft Yellow -  Copyright by Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/)
  2.  
  3.  
  4. --Update
  5.  
  6. BC(1)
  7. Clear()
  8.  
  9. file = fs.open("SimSoft/Data/SystemColor","r")
  10. local fileData = {}
  11. local line = file.readLine()
  12. repeat
  13. table.insert(fileData,line)
  14. line = file.readLine()
  15. until line == nil
  16. file.close()
  17.  
  18. SystemColor = fileData[3]
  19.  
  20. SystemColor = ((SystemColor-1)+1)
  21.  
  22. w, h = term.getSize()
  23.  
  24. wC = 0
  25. hC = 1
  26.    
  27. while true do
  28.  
  29.     wC = (wC+1)
  30.    
  31.     CP(wC, hC)
  32.     BC(SystemColor)
  33.     write(" ")
  34.    
  35.     if wC == w then
  36.         if hC == 3 then
  37.             break
  38.         else
  39.             hC = (hC+1)
  40.             wC = 0
  41.         end
  42.     end
  43.    
  44. end
  45.  
  46. anzeige = "SimSoft Update System"
  47.  
  48. TC(1)
  49. CP(((w/2)-((#anzeige)/2)),2)
  50.  
  51. print(anzeige) 
  52.  
  53.  
  54. BC(1)
  55. TC(128)
  56.  
  57. CP(4,6)
  58. print("Loading Update File...")
  59.  
  60.  
  61. local datei = http.get("http://pastebin.com/raw/DkuTZtem")
  62. datei = datei.readAll()
  63.  
  64. local file = fs.open("SimSoft/Data/UpdateTemp", "w")
  65. file.write(datei)
  66. file.close()
  67.  
  68. file = fs.open("SimSoft/Data/Version","r")
  69. local fileData = {}
  70. local line = file.readLine()
  71. repeat
  72. table.insert(fileData,line)
  73. line = file.readLine()
  74. until line == nil
  75. file.close()
  76.    
  77. SystemVersion = fileData[3]
  78.    
  79. file = fs.open("SimSoft/Data/UpdateTemp","r")
  80. local fileData = {}
  81. local line = file.readLine()
  82. repeat
  83. table.insert(fileData,line)
  84. line = file.readLine()
  85. until line == nil
  86. file.close()
  87.  
  88. C = 3
  89.  
  90. while true do
  91.    
  92.     onlineVersion = fileData[(C-2)]
  93.     onlineUpdateCode = fileData[(C-1)]
  94.    
  95.     if SystemVersion == onlineVersion then
  96.         if C == 3 then
  97.            
  98.             updateErgebnis = false
  99.             break
  100.            
  101.         else
  102.        
  103.             updateErgebnis = true
  104.             break
  105.            
  106.         end
  107.    
  108.     else
  109.        
  110.         C = (C+3)
  111.        
  112.     end
  113.    
  114. end
  115.  
  116. TC(128)
  117. CP(4,7)
  118. print("> File Successfully Loaded!")
  119.  
  120. TC(128)
  121. CP(4,8)
  122. print("Checking System And Online Version...")
  123.  
  124.  
  125.  
  126. if updateErgebnis == false then
  127.     TC(32)
  128.     CP(4,10)
  129.     print("> Your System Is Up To Date!")
  130.     sleep(2)
  131.    
  132. else
  133.  
  134.     TC(16384)
  135.     CP(4,10)
  136.     print("> Your System Is Not Current!")
  137.    
  138.     TC(128)
  139.     CP(4,10)
  140.     shell.run("pastebin run "..onlineUpdateCode)
  141.     os.reboot()
  142.    
  143. 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