Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function status()
- shell.run("monitor","top","status")
- end
- status()
- timesFailed = 0
- broken = false
- while true do
- term.clear()
- term.setCursorPos(1,1)
- timesFailed= timesFailed+1
- print("Program stopped. restarting in 5 seconds...")
- print("Program has Failed "..timesFailed.." times.")
- print("'T' to break")
- restartTimer = os.startTimer(5)
- while not broken do
- e, p1 = os.pullEvent()
- if e == "timer" and p1 == restartTimer then
- print(restartTimer)
- print(p1)
- status()
- break
- elseif e == "char" and p1 == "t" then
- broken = true
- break
- end
- end
- if broken == true then break end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement