LezChap

Turbine Poller

Jul 12th, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. turbines = { peripheral.find("BigReactors-Turbine") }
  2. reactor = peripheral.find("BigReactors-Reactor")
  3. mon = peripheral.find("monitor")
  4.  
  5. while true do
  6.   mon.clear()
  7.   local totalRF = 0
  8.   for i = 1, #turbines do
  9.     mon.setCursorPos(1, i)
  10.     mon.write("Turbine "..i.." RPM: "..tostring(turbines[i].getRotorSpeed()))
  11.     mon.write(" || ")
  12.     mon.write("Power Produced: "..tostring(turbines[i].getEnergyProducedLastTick()))
  13.     totalRF = totalRF + turbines[i].getEnergyProducedLastTick()
  14.   end
  15.   mon.setCursorPos(1, #turbines + 2)
  16.   mon.write("Reactor temp: "..tostring(reactor.getCasingTemperature()).." || Total Energy Made: "..totalRF)
  17.   sleep(1)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment