Kaosce

Reactor_Managing

Mar 23rd, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function mvprint(lign, col, str)
  2.   term.setCursorPos(col, lign)
  3.   print(str)
  4. end
  5.  
  6. reactor = peripheral.wrap("back")
  7.  
  8. while true do
  9.   term.clear()
  10.   mvprint(2, 13, "Currently Managing Reactor")
  11.   local stored = reactor.getEnergyStored()
  12.   mvprint(10, 8, "Energy stored : "..stored.." / 10 000 000")
  13.   local produced = math.floor(reactor.getEnergyProducedLastTick())
  14.   mvprint(5, 8, "Production rate : "..produced.." /t")
  15.   local energy = stored * 100 / 10000000
  16.   mvprint(12, 24, math.floor(energy).."%")
  17.   mvprint(15, 8, "Activite : "..tostring(reactor.getActive()))
  18.   if energy < 80 then
  19.     reactor.setActive(true)
  20.   else
  21.     reactor.setActive(false)
  22.   end
  23. sleep(1)
  24. end
Add Comment
Please, Sign In to add comment