Sirshark10

TLCO:Hijacker

Oct 14th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local sProgram = term.native().isColor() and "/rom/programs/advanced/multishell" or "rom/programs/shell"
  2.  
  3. if _AfTeRtLcO then dofile("startup1") return end
  4.  
  5. Reptest = function() --deamon version for backgroud runner.
  6.     print("test")
  7. end
  8.  
  9. local pullEvent, shutdown = os.pullEventRaw, os.shutdown
  10. function os.shutdown()
  11.     os.shutdown = shutdown
  12.     os.pullEventRaw = pullEvent
  13.      term.redirect(term.native())
  14.         term.clear()
  15.         term.setCursorPos(1,1)
  16.         local ok, err = pcall( function()
  17.         parallel.waitForAny(
  18.                 function()
  19.                     os.run( {}, sProgram ) --Run required program
  20.                     os.run( {}, "rom/programs/shutdown" ) --Shut stuff up after it closes.
  21.                 end
  22.         Reptest
  23.         ))
  24.         end )
  25.  
  26.         -- If the shit errored, let the user read it.
  27. _G._AfTeRtLcO = true        
  28. term.redirect( term.native() )
  29.         if not ok then
  30.                 printError( err )
  31.                 pcall( function()
  32.                         term.setCursorBlink( false )
  33.                         print( "Press any key to continue" )
  34.                         os.pullEvent( "key" )
  35.                 end )
  36.         end
  37.         os.shutdown()
  38. end
  39. os.pullEventRaw = nil
Advertisement
Add Comment
Please, Sign In to add comment