Advertisement
Jeyjey0

updater

Apr 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("Check for Internet Connection...")
  4. Connection = false
  5. function invisiblepastebin(code,name)
  6. local response = http.get(
  7. "http://pastebin.com/raw/"..code
  8. )
  9.  
  10. if response then
  11.  
  12. local sResponse = response.readAll()
  13. response.close()
  14. h = fs.open(name,"w")
  15. h.write(sResponse)
  16. h.close()
  17. Connection = true
  18. return sResponse
  19. else
  20. Connection = false
  21. end
  22. end
  23. invisiblepastebin("0K6gN8u8","asudixjasdiojasjdojosjiaojij")
  24. fs.delete("asudixjasdiojasjdojosjiaojij")
  25. if Connection then
  26. sleep(0.3)
  27. print("Internet Connection: YES")
  28. print("Checking for updates...")
  29. fs.delete("updateFILE")
  30. invisiblepastebin("0K6gN8u8","updateFILE")
  31. local h = fs.open("updateFILE","r")
  32. text = h.readAll()
  33. h.close()
  34. if text == "false" then
  35. print("No Update Found")
  36. else
  37. fs.delete("updateFILE")
  38. print("Updateing...")
  39. invisiblepastebin(text,"UPDATEFILE123")
  40. shell.run("UPDATEFILE123")
  41. fs.delete("UPDATEFILE123")
  42.  
  43. fs.delete("updateFILE")
  44.  
  45. end
  46. else
  47. sleep(0.3)
  48. print("Can not update no Internet Connection ")
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement