5bitesofcookies

launchGlassBETA2

Oct 18th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. --[[
  2. Glass launcher
  3. Ensures Glass won't crash and leave you stranded
  4. somewhere or something by rebooting it.
  5. Cool stuff.
  6. ]]
  7. function launch()
  8. errort("TEST")
  9. shell.run("Glass")
  10. end
  11.  
  12.  
  13. local go = true
  14. while go do
  15. goodShutdown = false
  16. shell.run('Glass')
  17. print("Launching Glass")
  18. print"launching"
  19. okay, err = pcall(reboot)
  20. print(okay)
  21. print(error)
  22. print(goodShutdown)
  23. if goodShutdown then
  24. local go = false
  25. break
  26. end
  27. if goodShutdown then
  28. glass.clear()
  29. crashBox = glass.addBox(0,0,150,75,glcolors.red,0.75)
  30. crashBox.setZIndex(-1)
  31. print(error)
  32. if error == error then
  33. error = "Unknown"
  34. end
  35. textOne = glass.addText(0,0,"Glass has crashed!",glcolors.white)
  36. textTwo = glass.addText(0,10,"Error: "..error,glcolors.white)
  37. textThree = glass.addText(0,20,"Do anything to relaunch.", glcolors.white )
  38. os.pullEvent("chat_command")
  39. end
  40.  
  41.  
  42.  
  43.  
  44. end
  45.  
  46. --if glass exits normally this won't be triggered
  47.  
  48.  
  49.  
  50.  
  51. goodShutdown = nil
  52. glass.clear()
Advertisement
Add Comment
Please, Sign In to add comment