Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this program acts as a crash menu, allowing the user to choose what action to take once a crash has occured
- os.pullEvent = os.pullEventRaw
- version = "1.0.0"
- settings.load(".settings")
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function DrawMenu()
- term.setCursorPos(1,6)
- print("SECURITY HANDLER - CRASH MENU")
- print("a crash/Terminate event has occured,")
- print("please choose one of the following")
- print("--Options--")
- print("1 - return to menu")
- print("2 - reboot")
- print("3 - shutdown")
- local event
- repeat
- event = {os.pullEvent("key")}
- until event[2] == keys.one or event[2] == keys.two or event[2] == keys.three
- if event[2] == keys.one then
- shell.run(settings.get("os_DesktopLoc"))
- elseif event[2] == keys.two then
- os.reboot()
- elseif event[2] == keys.three then
- os.shutdown()
- end
- DrawMenu()
- end
- DrawMenu()
Add Comment
Please, Sign In to add comment