5bitesofcookies

Glass Launcher V0.3.3

Oct 19th, 2013
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 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. local devmsgs = false
  8. function launch()
  9. errort("TEST")
  10. shell.run("Glass")
  11. end
  12.  
  13.  
  14. local go = true
  15. while go do
  16. goodShutdown = false
  17. shell.run('Glass')
  18. if devmsgs then
  19. print("Launching Glass")
  20. print"launching"
  21. end
  22. okay, err = pcall(reboot)
  23. if devmsgs then
  24. print(okay)
  25. print(error)
  26. print(goodShutdown)
  27. end
  28. if goodShutdown then
  29. local go = false
  30. break
  31. end
  32. if not goodShutdown then
  33. glass.clear()
  34. crashBox = glass.addBox(130,80,150,75,glcolors.red,0.75)
  35. crashBox.setZIndex(-1)
  36. if devmsgs then
  37. print(error)
  38. end
  39. if error == error then
  40. error = "???"
  41. end
  42. textOne = glass.addText(130,80,"Glass has crashed!",glcolors.white)
  43. textTwo = glass.addText(130,90,"Error: "..error,glcolors.white)
  44. textThree = glass.addText(130,100,"Do anything to relaunch, or", glcolors.white )
  45. textFour = glass.addText(130,110,"shutdown to shutdown.",glcolors.white)
  46. _, cmd = os.pullEvent("chat_command")
  47. cmd = string.lower(cmd)
  48. if cmd == "shutdown" then
  49. break
  50. end
  51. end
  52. end
  53.  
  54.  
  55.  
  56.  
  57.  
  58. --if glass exits normally this won't be triggered
  59.  
  60.  
  61.  
  62.  
  63. goodShutdown = nil
  64. glass.clear()
Advertisement
Add Comment
Please, Sign In to add comment