Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Glass launcher
- Ensures Glass won't crash and leave you stranded
- somewhere or something by rebooting it.
- Cool stuff.
- ]]
- function launch()
- errort("TEST")
- shell.run("Glass")
- end
- local go = true
- while go do
- goodShutdown = false
- shell.run('Glass')
- print("Launching Glass")
- print"launching"
- okay, err = pcall(reboot)
- print(okay)
- print(error)
- print(goodShutdown)
- if goodShutdown then
- local go = false
- break
- end
- if goodShutdown then
- glass.clear()
- crashBox = glass.addBox(0,0,150,75,glcolors.red,0.75)
- crashBox.setZIndex(-1)
- print(error)
- if error == error then
- error = "Unknown"
- end
- textOne = glass.addText(0,0,"Glass has crashed!",glcolors.white)
- textTwo = glass.addText(0,10,"Error: "..error,glcolors.white)
- textThree = glass.addText(0,20,"Do anything to relaunch.", glcolors.white )
- os.pullEvent("chat_command")
- end
- end
- --if glass exits normally this won't be triggered
- goodShutdown = nil
- glass.clear()
Advertisement
Add Comment
Please, Sign In to add comment