Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pullEvent = os.pullEvent
- local flag = true
- local c1 = peripheral.wrap("computer_1")
- local c2 = peripheral.wrap("computer_2")
- local c3 = peripheral.wrap("computer_4")
- local input
- function boot()
- c1.turnOn()
- c2.turnOn()
- c3.turnOn()
- end
- function readInput()
- input = read()
- if input == "boot" then
- boot()
- print("Booting system")
- sleep(1)
- end
- if input == "adminmodegogo" then
- flag = false
- os.pullEvent = pullEvent
- print("Hold Ctrl + T to break")
- end
- if input == "shutdownmeow" then
- print("Shutting down")
- c1.shutdown()
- c2.shutdown()
- c3.shutdown()
- sleep(1)
- os.shutdown()
- end
- end
- function start()
- if flag then
- term.clear()
- term.setCursorPos(1,1)
- print("Type boot to start system")
- end
- if flag then
- os.pullEvent = os.pullEventRaw
- end
- end
- while true do
- start()
- readInput()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement