Sxw1212

Life

Feb 16th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Downloading latest version from github...")
  2. fh=http.get("https://raw.github.com/Sxw1212/cclife/master/life.lua")
  3. if fh then
  4. code=fh.readAll()
  5. fh.close()
  6. print("Launching...")
  7. for k,v in pairs(rs.getSides()) do
  8. if peripheral.getType(v)=="monitor" then
  9. print("Monitor found...")
  10. monitor=true
  11. monitorc=v
  12. end
  13. end
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. print("Please choose a save file.")
  17. write("File:")
  18. file=read()
  19. if monitor then
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. print("Monitor detected. Enable?")
  23. write("yes/no[yes]:")
  24. local ans=read()
  25. if ans=="yes" or ans=="" then
  26. print("Monitor enabled!")
  27. mon=peripheral.wrap(monitorc)
  28. term.redirect(mon)
  29. pcall(loadstring(code), file)
  30. term.restore()
  31. else
  32. pcall(loadstring(code), file)
  33. end
  34. else
  35. pcall(loadstring(code), file)
  36. end
  37. print("Exited")
  38. else
  39. print("Failed to download new version")
  40. end
Advertisement
Add Comment
Please, Sign In to add comment