Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • Announcements

    • Lizzy Trickster

      Latest Stable OpenComputers Version   11/26/16

      The latest released version of OpenComputers is version 1.7.1 for MC 1.7.10, 1.10.2, 1.11.2 & 1.12.1. See more information here! Beta/Dev builds can be found at the Jenkins Build Server (ci.cil.li)

Question

I am looking for a program that would work similar to the Ender IO power monitor. Im trying to avoid having my generators flickering on and off, because its starting to cause a rfair bit of lag

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

----> UNTESTED <----

I think this should work.

Quote

local component = require("component")
local redstone = component.redstone

while true do
    local energie = 0
    local maxenergie = 0
    for adresse in pairs(component.list("capacitor_bank")) do
        energie = energie + component.proxy(adresse).getEnergyStored()
        maxenergie = maxenergie + component.proxy(adresse).getMaxEnergyStored()
    end
    local prozent = energie / maxenergie
    if prozent > 0.8 then
        redstone.setOutput(0, 0)
    elseif prozent < 0.4 then
        redstone.setOutput(0, 255)
    end
    os.sleep(15)
end

 

Share this post


Link to post
Share on other sites
  • 0

Place an adapter next to a Capacitor bank.

The computer needs cpu, ram, disk, openos, lua bios, redstone card. It should emit a redstone signal to the bottom if the generators have to be turned on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×