Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w,h = term.getSize()
- local wm, hm, monitor
- local machine = "back"
- local lights = "right"
- local Monitor = "top"
- local Modem = "left"
- local password = "necas"
- local opentime = 120
- local systime = 2
- local title = "Welcome NeluxOS"
- local iniText = "Iniciating system test"
- local lightsText = "Lights on?"
- local lightsOtext = "Lights stay off"
- local passwordText = "Password:"
- local passwordCtext = "Password correct!"
- local passwordItext = "Password incorrect!"
- local factoryWtext = "Factory is working..."
- local factoryStext = "Factory has stop"
- function startMonitor()
- peripheral.call(Monitor, "write", "Test")
- monitor = peripheral.wrap(Monitor)
- wm, hm = monitor.getSize()
- end
- function clearScreen()
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.green)
- monitor.clear()
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.green)
- monitor.setTextScale(.5)
- end
- function cleanline()
- monitor.clearLine(2,x)
- term.clearLine(2,x)
- end
- function screenTpos()
- term.setCursorPos(1,1)
- monitor.setCursorPos(1,1)
- end
- function screenGpos()
- term.setCursorPos(1,2)
- monitor.setCursorPos(1,2)
- end
- function startModem()
- modem = peripheral.wrap(Modem)
- modem.open(0)
- modem.isOpen(0)
- --modem.closeAll()
- end
- x = function()
- print(t)
- monitor.write(t,wm)
- modem.transmit(0,1,t)
- end
- startMonitor()
- startModem()
- for k,v in pairs(peripheral.getMethods(Monitor)) do
- print(v)
- print("Terminal size = " .. w .. "," .. h)
- print("Monitor size = " .. wm .. "," .. hm)
- end
- clearScreen()
- screenTpos()
- t = title
- x()
- sleep(systime)
- screenGpos()
- t = iniText
- x()
- sleep(systime)
- sleep(4)
- cleanline()
- while true do
- screenGpos()
- t = lightsText
- x()
- local input = read()
- if input == "yes" then
- cleanline()
- screenGpos()
- rs.setOutput(lights,true)
- else
- cleanline()
- screenGpos()
- t = lightsOtext
- x()
- end
- cleanline()
- screenGpos()
- t = passwordText
- x()
- local input = read("*")
- if input == password then
- cleanline()
- screenGpos()
- t = passwordCtext
- x()
- sleep(systime)
- rs.setOutput(machine,true)
- cleanline()
- screenGpos()
- t = factoryWtext
- x()
- sleep(opentime)
- screenGpos()
- rs.setOutput(machine,false)
- t = factoryStext
- x()
- cleanline()
- screenGpos()
- else
- t = passwordItext
- x()
- sleep(2)
- os.shutdown()
- --shell.run(boolean)
- clearScreen()
- screenTpos()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement