Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require('component')
- local reactor
- local rs = component.redstone
- local note = require('note')
- local heat
- local try
- local aftr
- local term = require('term')
- n = 0
- if component.isAvailable('reactor') then
- reactor = component.reactor
- elseif component.isAvailable('reactor_chamber') then
- reactor = component.reactor_chamber
- else
- print("Реактор не подключен")
- os.exit()
- end
- rs.setOutput(2, 0)
- function start()
- while n == 0 do
- temp = tostring(reactor.getHeat())
- heatfloor = tostring(math.floor(reactor.getHeat()/reactor.getMaxHeat()*100+0.5))
- message = "Нагрев реактора: " .. temp .. " (" .. heatfloor .. "%)"
- term.clear()
- print(message)
- heat = reactor.getHeat()/reactor.getMaxHeat()*100
- end
- end
- function password()
- while true do
- if n == 1 then
- while true do
- io.write("Введите код безопасности: ")
- err, aftr = pcall(io.read)
- if aftr == "124" then
- n = 0
- term.clear()
- print("Code true")
- while true do
- io.write("Введите пароль: ")
- err, try = pcall(io.read)
- if try == "123" then
- rs.setOutput(2, 15)
- start()
- else
- rs.setOutput(2, 0)
- print("Пароль неверный!")
- end
- end
- else
- print("Код безопасности неверный. Запуск невозможен!")
- end
- end
- else
- io.write("Введите пароль: ")
- err, try = pcall(io.read)
- if try == "123" then
- rs.setOutput(2, 15)
- start()
- else
- rs.setOutput(2, 0)
- print("Пароль неверный!")
- end
- end
- end
- end
- password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement