reading energy level from redstone energy cell

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Azurl

New Member
Jul 29, 2019
172
0
0
Hi! I want to automate power generation from industrialcraft to buildcraft with electrical engines, I have hooked up their output to a redstone energy cell. Can a computercraft computer read the energy level somehow? I want to make it activate the engines when the cell is empty, and turn them off when the cell is full. possible?
 

INCSlayer

Well-Known Member
Nov 17, 2012
185
48
53
i think there is or is atleast plans from what i have seen in DW20s videos of a block that computercraft can use in the same way a gate works for buildcraft pipes so it is or will be possible
 

MilConDoin

New Member
Jul 29, 2019
1,204
0
0
If that block ain't there currently:
hook a power pipe with a gate on it to the cell (pipe (not wooden!) leading nowhere). Set the gate to full = signal on and empty = signal on. Whenever your CC gets a rising edge, act accordingly. (cell becomes empty -> rising edge -> CC starts the engines -> falling edge -> cell becoms full after a while -> rising edge -> CC stops engines)
 

Azurl

New Member
Jul 29, 2019
172
0
0
which gate would that be? because with a Gate, all the alternatives I get when one piece of golden conductive pipe is connected to the cell with the gate in it are: pipe empty, power traversing, redstone signal on, redstone signal off.
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
Since hookup up a pipe to a energy conduit would lead to all the power being drained I don't think that's feasable.
 

SilvasRuin

New Member
Jul 29, 2019
817
0
0
Structure Pipes are what you use when you don't want the pipe itself to interact with something, but you want a gate to. I was addressing the energy drain potential problem Hydra mentioned.
 

Azurl

New Member
Jul 29, 2019
172
0
0
Alright, I understand that, but which gate exactly do I use? the basic gate won't give me energy level or tank status or anything.
 

SilvasRuin

New Member
Jul 29, 2019
817
0
0
Diamond Autarchic Gates seem to be able to detect energy levels. So can Gold. And Iron for that matter. Uh... doesn't look like you even need an Autarchic Gate to check that.

Edit: Okay, now I'm REALLY confused. Even the most basic Gate can detect No Energy, Energy Stored, Can Store Energy, and Full Energy. I'm not sure what you're doing to not see these options.
 

Azurren

New Member
Jul 29, 2019
14
0
0
Hmmmm..
Place a structure pipe beside the Redstone Energy Cell and place any Buildcraft Gate onto it. There should be a buggy conditional "Full energy" in the left box. Set it to output a redstone signal in the right box.
Connect some redstone wire to you're ComputerCraft PC (Or just hard wire it to your engines with a redstone inverter)

This isn't 100% what you're after, but it will stop you're engines running when they don't have to.

Edit: You have to save-and-quit after placing the gate (With both boxes left blank). On re-loading the "Full energy" condition should be present
 

Azurl

New Member
Jul 29, 2019
172
0
0
the pipe wires won't connect to the gates. or anything, do I need something to make them connect?
 

AliasXNeo

New Member
Jul 29, 2019
171
0
0
Gates don't work with TE energy cells in 1.4.2. You need to be on the latest version for that to work. In the latest version attaching a gate to a power pipe attached to the cell will give an option for emitting a signal on various levels of energy.
 

Azurren

New Member
Jul 29, 2019
14
0
0
Gates don't work with TE energy cells in 1.4.2. You need to be on the latest version forthat to work. In the latest version attaching a gate to a power pipe attached to the cell will give an option for emitting a signal on various levels of energy.



FTB 1.4.2
It may not be pretty or exactly what you would like but it works flawlessly for turning off engines when the cell is full
 

AliasXNeo

New Member
Jul 29, 2019
171
0
0


FTB 1.4.2
It may not be pretty or exactly what you would like but it works flawlessly for turning off engines when the cell is full

If that was a response to it working, I don't consider a buggy implementation as 'working.'
 

Azurl

New Member
Jul 29, 2019
172
0
0
I got it to work! Iron or gates worked with the pipe wires, and it stops sending signal when the cell isn't full, excellent
 

The Heresiarch

New Member
Jul 29, 2019
18
0
0
Is there any way to read the exact amount of energy in a redstone energy cell (e.g. to display on a monitor)? I'm guessing not, but I wanted to check.
 

Azurl

New Member
Jul 29, 2019
172
0
0
nope sorry, you can read: if it can store energy, if it is full, if it is empty
 

shortybsd

New Member
Jul 29, 2019
30
0
0
Hi! I want to automate power generation from industrialcraft to buildcraft with electrical engines, I have hooked up their output to a redstone energy cell. Can a computercraft computer read the energy level somehow? I want to make it activate the engines when the cell is empty, and turn them off when the cell is full. possible?

Very late on replying to your question. Yes, you can use ComputerCraft to read a redstone energy cell. I see people where they said to use gates and so forth but this is very useful and can do a lot more than any gate. Here is a very simple example how to read the cell via ComputerCraft.
Code:
cell = peripheral.wrap("bottom")
cellStored = cell.getEnergyStored()
cellFull = cell.getMaxEnergyStored()
cellPercent = math.floor(100*cellStored/cellFull)

print(tonumber(cellStored))
print(cellFull)
-- Better format
print(tonumber(cellStored).."/"..cellFull.." "..cellPercent.."%")

On being more powerful than any gate, is you can use if then statements to do certain things, like change the output or input of the cell. You could have an exact number matched before it does something e.g. like 20% or a specific number 134777. Hope this helped.
 
Last edited: