Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sProgram = term.native().isColor() and "/rom/programs/advanced/multishell" or "rom/programs/shell"
- if _AfTeRtLcO then dofile("startup1") return end
- Reptest = function() --deamon version for backgroud runner.
- print("test")
- end
- local pullEvent, shutdown = os.pullEventRaw, os.shutdown
- function os.shutdown()
- os.shutdown = shutdown
- os.pullEventRaw = pullEvent
- term.redirect(term.native())
- term.clear()
- term.setCursorPos(1,1)
- local ok, err = pcall( function()
- parallel.waitForAny(
- function()
- os.run( {}, sProgram ) --Run required program
- os.run( {}, "rom/programs/shutdown" ) --Shut stuff up after it closes.
- end
- Reptest
- ))
- end )
- -- If the shit errored, let the user read it.
- _G._AfTeRtLcO = true
- term.redirect( term.native() )
- if not ok then
- printError( err )
- pcall( function()
- term.setCursorBlink( false )
- print( "Press any key to continue" )
- os.pullEvent( "key" )
- end )
- end
- os.shutdown()
- end
- os.pullEventRaw = nil
Advertisement
Add Comment
Please, Sign In to add comment