Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require('component')
- local cb=com.chat_box
- local red = com.redstone
- local event=require("event")
- local str=require("string")
- local react=com.reactor_chamber
- heat=0
- cb.setName("§6Реактор§8")
- while true do
- heat=react.getHeat()
- print(heat)
- if heat>0 and react.isActive()=="true" then
- cb.say("test")
- end
- if heat>0 and react.isActive()=="true" then
- red.setOutput(4,0)
- cb.say("§4Реактор аварийно остановлен, проверьте схему")
- end
- evt,_,plr,msg=event.pull("chat_message")
- if msg=="старт" and react.getHeat()==0 then
- if plr=="AndreyVodogrey" or plr=="atomzerg" then
- red.setOutput(4,1)
- cb.say("§4Реактор запущен")
- end
- end
- if msg=="выход" then
- if plr=="AndreyVodogrey" or plr=="atomzerg" then
- cb.say("§aВыход энергии= "..5*react.getReactorEnergyOutput().." §aEu/T")
- heat=react.getHeat()
- heat=heat/100
- cb.say("§aТемпература реактора="..heat.."%")
- end
- end
- if msg=="статус" then
- if plr=="atomzerg" or plr=="AndreyVodogrey" then
- if react.isActive()==true then
- cb.say("§aCейчас реактор работает")
- end
- if react.isActive()==false then
- cb.say("§aСейчас реактор не работает")
- cb.say("§aТемпература реактора="..heat.."%")
- end
- end
- end
- if msg=="стоп" then
- if plr=="AndreyVodogrey" or plr=="atomzerg" then
- red.setOutput(4,0)
- cb.say("§aРеактор остановлен")
- end
- end
- if msg=="старт" and plr=="atomzerg" and react.getHeat()>0 and red.getOutput(4)==0 then
- cb.say("§5Температура не позволяет запустить реактор")
- red.setOutput(4,0)
- end
- if msg=="старт" and plr=="AndreyVodogrey" and react.getHeat()>0 and red.getOutput(4)==0 then
- cb.say("§5Температура не позволяет запустить реактор")
- red.setOutput(4,0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement