Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p=peripheral.wrap("back")
- e=peripheral.wrap("tile_thermalexpansion_cell_reinforced_name_0")
- m=peripheral.wrap("monitor_1")
- function informacao(tipo)
- m.clear()
- m.setCursorPos(1,1)
- m.write("Energia Armazenada Atual: "..percent.." de 20000000 RF")
- m.setCursorPos(1,2)
- m.write("Reator: ".. status)
- m.setCursorPos(1,3)
- m.write("Energia Produzida: ".. p.getEnergyProducedLastTick())
- if tipo == "liga" then
- m.setCursorPos(1,4)
- m.write("Ligando Reator Energia Muito Baixa")
- elseif tipo == "desliga" then
- m.setCursorPos(1,4)
- m.write("Desligando Reator... Tudo Certo Agora")
- end
- end
- function controla()
- while true do
- sleep(1)
- energia=e.getEnergyStored()/20000000*100
- percent=(string.sub(energia, 1, 4) .. "%")
- if p.getEnergyStored() <= 20000 then
- p.setActive(true)
- informacao("liga")
- elseif e.getEnergyStored() >= 19900000 then
- p.setActive(false)
- informacao("desliga")
- else
- informacao("nada")
- end
- if p.getEnergyProducedLastTick() > 0 then
- status="Ligado"
- else
- status="Desligado"
- end
- end
- end
- controla()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement