Simlor_GER

SimSoft Update 4.0.1

Jul 9th, 2016 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. --SimSoft 4.0.1 Update
  2.  
  3. print("Start-Update 4.0.1")
  4.  
  5. local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
  6. local datei = http.get("https://pastebin.com/raw/4246xccR" .. "?cb=" .. cacheBuster)
  7. if not datei then
  8. BC(256)
  9. Clear()
  10. TC(16384)
  11. print("Please, check you internet connection!")
  12. print("Or try it later again.")
  13. sleep(3)
  14. else
  15.  
  16. --Download Function
  17.  
  18. function Download(CodePB, Pfad)
  19. local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
  20. local datei = http.get("https://pastebin.com/raw/" .. textutils.urlEncode(CodePB) .. "?cb=" .. cacheBuster)
  21. datei = datei.readAll()
  22.  
  23. local file = fs.open(Pfad, "w")
  24. file.write(datei)
  25. file.close()
  26. end
  27. fs.delete("SimSoft/System/SystemUpdate")
  28. Download("Yv4VUL6Z", "SimSoft/System/SystemUpdate")
  29.  
  30. fs.delete("SimSoft/System/SappS")
  31. Download("4246xccR", "SimSoft/System/SappS")
  32.  
  33. file = fs.open("SimSoft/Data/Config","r")
  34. local fileData = {}
  35. local line = file.readLine()
  36. repeat
  37. table.insert(fileData,line)
  38. line = file.readLine()
  39. until line == nil
  40. file.close()
  41.  
  42. a = fileData[1]
  43. b = fileData[2]
  44. version = "4.0.1"
  45. sprache = fileData[4]
  46.  
  47. local file = fs.open("SimSoft/Data/Config","w")
  48. file.close()
  49.  
  50. local file = fs.open("SimSoft/Data/Config","a")
  51. file.writeLine(a)
  52. file.writeLine(b)
  53. file.writeLine(version)
  54. file.writeLine(sprache)
  55. file.close()
  56. end
  57.  
  58. --end
Add Comment
Please, Sign In to add comment