Punio

ReactorInstaller

Jan 1st, 2016
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. local _exit = false
  2.  
  3. function _exitScript()
  4.    local event, key = os.pullEvent( "key" ) -- limit os.pullEvent to the 'key' event
  5.  
  6.    if key == keys.e then -- if the key pressed was 'e'
  7.       print("Script Stopped")
  8.       _exit = true
  9.    end
  10.    
  11.    return true
  12. end
  13.  
  14.  
  15. while not _exit do
  16.    term.clear()
  17.    term.setCursorPos(1,1)
  18.    
  19.    print("----- PRESS TO INSTALL -----")
  20.    print( "-- 1 to Install Monitor Script" )
  21.    print( "-- 2 to Install Sender Script" )
  22.    print ("-- 3 to Install Receiver Script")
  23.    print("")
  24.    print( "-- E to exit Script." )
  25.    print( "-- R to reboot system and start installed script." )
  26.  
  27.    local event, key = os.pullEvent( "key" ) -- limit os.pullEvent to the 'key' event
  28.  
  29.    if key == 2 then -- key 1
  30.       shell.run("rm startup")
  31.       shell.run("pastebin get tHrMpZTC startup")
  32.    elseif key == 3 then -- key 2
  33.       shell.run("rm startup")
  34.       shell.run("pastebin get tHrcJsQd startup")
  35.    elseif key == 4 then -- key 3
  36.       shell.run("rm startup")
  37.       shell.run("pastebin get uZ8NFbSF startup")
  38.    elseif key == keys.e then -- e
  39.       print("Script Stopped")
  40.       _exit = true
  41.    elseif key == keys.r then -- r
  42.       os.reboot()
  43.    end
  44.    
  45.    if not _exit then
  46.       sleep(3)
  47.      
  48.       print("Complete")
  49.      
  50.       sleep(5)
  51.    end
  52. end
Add Comment
Please, Sign In to add comment