Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. cpt=require("component")
  2. term=require("term")
  3. nucleo=cpt.proxy(cpt.get("f7cf"))
  4.  
  5. local function limpar()
  6.  term.clear()
  7.  term.setCursor(1,1)
  8. end
  9. local status="ligando"
  10. while true do
  11.  local ener=nucleo.getEnergyStored()
  12.  if status=="desligando" then
  13.   limpar()
  14.   print("Reator Desligado por Excesso de Energia")
  15.  end
  16.  if ener==10000000 then
  17.   nucleo.setActive(false)
  18.   local status="desligando"
  19.  end
  20.   term.pull(5)
  21.  if ener<8000000 then
  22.   local fissil=nucleo.getFuelAmount()
  23.   local prod=nucleo.getEnergyProducedLastTick()
  24.   local cons=nucleo.getFuelConsumedLastTick()
  25.   if fissil==0 then
  26.    limpar()
  27.    print("Reacao Interrompida por Falta de Material Fissil")
  28.    term.pull(2)
  29.   else
  30.    nucleo.setActive(true)
  31.    local status="ligando"
  32.    limpar()
  33.    print("Reacao em Andamento")
  34.    print("Energia Armazenada(RF): "..ener)
  35.    print("Material Fissil Restante (mB): "..fissil)
  36.    print("Producao Atual(RF/t): "..prod)
  37.    print("Consumo de Material Fissil(mB/t): "..cons)
  38.    term.pull(0.5)
  39.   end
  40.  end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement