This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Bananas's profile picture

Monitor Energy Production

Started by Bananas, 08 December 2013 - 01:22 PM
Bananas #1
Posted 08 December 2013 - 02:22 PM
I've combed through the peripherals and programming boards, but couldn't find any premade programs for tekkitmain that will display how much energy is being produced/stored by your system. In my particular case, I'd like to see how much energy is being stored in my redstone energy cells, and how much energy my biofuel generators are producing. The closest thing I found was this: http://www.computerc...__fromsearch__1

Am I missing something here? It seems utterly strange that there's no program like this. Thanks in advance!
gezepi #2
Posted 12 December 2013 - 08:22 PM
OpenPeripherals lets CC communicate with a lot of blocks as peripherals. I'm using a computer to turn my engines on when the level of an energy cell falls too low and turns them off when it is charged, works great at saving fuel.
If you want a percentage it would be something like:

bat = peripheral.wrap("top")
local function getPercent()
  local amount = bat.getEnergyStored()
  local percent = 0
  if amount ~= nil then
    percent = amount / bat.getMaxEnergyStored()
  end
  return percent
end