I'm using this code from How do I detect if MFSU has half below energyHow do I detect if MFSU has half below energy, from an answeran answer about half way down the page:
mfe = peripheral.wrap("left")
while true do
euPercent = mfe.getEUStored() / mfe.getEUCapacity()
if euPercent==1 then
redstone.setOutput("right", false)
elseif euPercent<=.5 then
redstone.setOutput("right", true)
end
sleep(1)
end
This is so that I can have my computer turn off my nuclear reactor when it's full of power and on when it's not full, but when I run the program it says
reactor:3: attempt to index ? (a nil value)