How do I detect if MFSU has half below energy
Solution 1:
2 solutions:
Method 1
I know you said you didn't want to use ComputerCraft however it's a more adaptable way than the other if you want to add more MFSU's. If you do, comment and I'll respond with info on how to. Put down a computer and do
edit reactor
In this file put:
mfe = peripheral.wrap("side")
while true do
euPercent = mfe.getEUStored() / mfe.getEUCapacity()
if euPercent==1 then
redstone.setOutput("side", false)
elseif euPercent<=.5 then
redstone.setOutput("side", true)
end
sleep(1)
end
Save by hitting CTRL, selecting "Save" with the arrows, and hitting ENTER. Hit CTRL again, select "Exit" with the arrows, and hit ENTER.
Let's explain what that does:
mfe = peripheral.wrap("side")
assigns the mfsu variable to peripheral.wrap("side")
. Make sure to replace side with the side the MFSU is on.
while true do
starts a while loop. This will do the code inside every tick unless there is a sleep.
euPercent = mfsu.getEUStored() / mfsu.getEUCapacity()
reads the EU and divides it by the total capacity to get a decimal out of the total.
if euPercent==1 then
checks if the MFSU is full. If it is, it runs any code till an else
or end
.
redstone.setOutput("side", false)
sets the redstone output being emitted from side
to false, turning off the reactors. Make sure you change side to the side which the redstone leading to your reactors is.
else if euPercent<=.5 then
ends the code run by the previous if and starts an else if
. This will, if the previous if is false, tests for if the if is true and if so, behaves the same as the if above.
redstone.setOutput("side", true)
sets the redstone output being emitted from side
to true, turning on the reactors. Make sure you change side to the side which the redstone leading to your reactors is.
sleep(1)
waits for 1 second before going to the top of the while loop and running it all again.
Next, do edit startup
. This will create a file run on startup of the computer. In it put:
shell.run("reactor")
This means that on startup the reactor file created earlier will have the code in it run.
Method 2
Use a BuildCraft gate to detect when the MFSU is full and output a redstone signal. Then, invert this with a redstone torch. I'll add more details when I can(tommrow EST at like 9 AM).