And what all would I need to know to do this, if it is possible?
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Controlling Resonant Energy Cells
Started by LKnives, 11 March 2014 - 02:31 AMPosted 11 March 2014 - 03:31 AM
Is it possible to control resonant energy cells with ComputerCraft? I want to make my power generation system smart, would it be possible to control how much energy drain a cell needs to go through before it asks for power from 2 other cells (If it would draw from the both equally, that'd be awesome), and then with those 2 cells drain their dynamos activate to re power them?
And what all would I need to know to do this, if it is possible?
And what all would I need to know to do this, if it is possible?
Posted 11 March 2014 - 06:25 AM
what mod are Resonant Energy Cells from?
Posted 11 March 2014 - 07:19 AM
Thermal expansionwhat mod are Resonant Energy Cells from?
Posted 11 March 2014 - 10:17 AM
Yes you can use Energy Cells as peripherals, you cannot change it's input/output rates though, but you can get it's current and maximum energy storage.
Edited on 11 March 2014 - 09:28 AM
Posted 11 March 2014 - 11:32 AM
Provided you have openPeripherals installed.
Posted 11 March 2014 - 05:14 PM
I have OpenPeripherals, sorry this is in Direwolf20 betapack 1.0.18.
Is it possible to check how much energy is being drawn from the cells?
Is it possible to check how much energy is being drawn from the cells?
Posted 11 March 2014 - 06:35 PM
I know you can see how much you have, but I don't know how…
Posted 11 March 2014 - 08:12 PM
To see what methods a peripheral has, you can use this script.
Off the top of my head I think the method that gets energy is getStoredEnergy()
Also, I don't remember if you can throttle the input and output but you can turn output off by supplying a Redstone signal if your cells are set up for it.
for k,v in pairs(peripheral.getMethods("side") do
print(v)
end
Off the top of my head I think the method that gets energy is getStoredEnergy()
Also, I don't remember if you can throttle the input and output but you can turn output off by supplying a Redstone signal if your cells are set up for it.
Edited on 11 March 2014 - 07:15 PM
Posted 11 March 2014 - 09:46 PM
Better yet you could use the openP included program called docs, found in the openp folder of all cc computers next to an openp peripheral. With this you can get function descriptions aswell as arguments.
Edited on 11 March 2014 - 08:46 PM
Posted 12 March 2014 - 02:24 AM
Yep that is correct. link.Off the top of my head I think the method that gets energy is getStoredEnergy()
Posted 12 March 2014 - 02:47 PM
Okay, can someone help me set this up.
I want to have a computer display the power levels of each of my energy cells, of which I have 3, how do?
I want to have a computer display the power levels of each of my energy cells, of which I have 3, how do?
Posted 12 March 2014 - 07:35 PM
What I prefer to do when collecting information from multiple sources, is to wrap the peripherals to a index inside a table. Normally when you wrap a peripheral it looks something like this:
[indent=1]Note: If you are using wired modems and network cable, instead of a side you want to use the name of the peripheral. The name you need to use will be displayed in your chatbox in Minecraft when you enable the modem connected to the peripheral.[/indent]
local var = peripheral.wrap("side")
You can do the same thing with a table.local table = {}
table[1] = peripheral.wrap("side")
This does the exact same thing as before, but instead of saving the wrapped peripheral inside the variable named "var" you are saving it to an index in a table. If you want to call a method for a peripheral wrapped this way, you simply write it the same way but use the table index instead.[indent=1]Note: If you are using wired modems and network cable, instead of a side you want to use the name of the peripheral. The name you need to use will be displayed in your chatbox in Minecraft when you enable the modem connected to the peripheral.[/indent]
table[1].method()
You can also use keys if you prefer, but I feel indexes are easier to code for. Now that we have our table of peripherals, you can use a loop to iterate through them all.for i = 1, #table do
table[i].method()
end
Posted 12 March 2014 - 07:58 PM
So, I hooked up wired networks to each energy cell, the name I want then is this cofh_thermalexpansion_energycell_0? My other two are 1 and 2.
Posted 12 March 2014 - 08:07 PM
That sounds correct. For any peripheral that you connect a wired modem to, you use the name it displays when you turn the modem on.
Posted 12 March 2014 - 08:45 PM
So I write a program with at the start
And then?
for i = 1, #table do
table[i].method()
end
And then?