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.
- ]]
- local devmsgs = false
- function launch()
- errort("TEST")
- shell.run("Glass")
- end
- local go = true
- while go do
- goodShutdown = false
- shell.run('Glass')
- if devmsgs then
- print("Launching Glass")
- print"launching"
- end
- okay, err = pcall(reboot)
- if devmsgs then
- print(okay)
- print(error)
- print(goodShutdown)
- end
- if goodShutdown then
- local go = false
- break
- end
- if not goodShutdown then
- glass.clear()
- crashBox = glass.addBox(130,80,150,75,glcolors.red,0.75)
- crashBox.setZIndex(-1)
- if devmsgs then
- print(error)
- end
- if error == error then
- error = "???"
- end
- textOne = glass.addText(130,80,"Glass has crashed!",glcolors.white)
- textTwo = glass.addText(130,90,"Error: "..error,glcolors.white)
- textThree = glass.addText(130,100,"Do anything to relaunch, or", glcolors.white )
- textFour = glass.addText(130,110,"shutdown to shutdown.",glcolors.white)
- _, cmd = os.pullEvent("chat_command")
- cmd = string.lower(cmd)
- if cmd == "shutdown" then
- break
- end
- end
- end
- --if glass exits normally this won't be triggered
- goodShutdown = nil
- glass.clear()
Advertisement
Add Comment
Please, Sign In to add comment