Jump to content




TE energy cell/EnderIO Capacitor bank power monitor program


8 replies to this topic

#1 RickiHN

  • Members
  • 15 posts

Posted 16 August 2014 - 06:18 PM

Wrote this simple plug'n'play script with the purpose of monitoring a TE3 Energy cells or EnderIO Capacitor Banks energy level and use it to output a redstone signal to toggle power production accordingly.

Posted Image


The script will by default detect any Cell or Capacitor adjacent or connected by cabled modems automatically and output a redstone signal out the back of the Computer once energy level falls below 10%. Redstone signal is then cut once energy levels are once again above 90%. (These percentages can easily be altered in the top of the code). For now it is limited to supporting just one Cell/capacitor per computer.

Should you wish to (it is entirely optional), the script will support and automatically detect an Advanced Monitor (1 high, 2 wide) either adjacent or attached by cabled modem. This will display the current state of the redstone signal and the current and maximum energy storage.

Great for preserving fuel in starter setups by controlling engines/dynamos/etc. to only run when needed.

http://pastebin.com/rjfa4ymR

#2 Strange

  • Members
  • 6 posts

Posted 09 January 2015 - 04:55 PM

Sorry to necro - does this require OpenPeripherals? Doesn't work for me (can't find the storage).

strange

#3 Gomo

  • Members
  • 19 posts

Posted 25 January 2015 - 06:43 PM

View PostStrange, on 09 January 2015 - 04:55 PM, said:

Sorry to necro - does this require OpenPeripherals? Doesn't work for me (can't find the storage).

strange

Yes, it does.

On topic:
I'm still new at Computercraft and I'm amazed how awesome this program is. I love it!
I've been trying to change it a bit so it would display larger amounts of energy (milions of RF) but whenever I change one part, the rest doesn't seem to work. >.>
Could you please modify it a bit so that it accepts larger capacity - more energy cells? I'd really appreciate it!

#4 chanzie

  • Members
  • 3 posts

Posted 13 February 2015 - 01:24 PM

will this also work for mekanism's energy cubes?

#5 Umaroth

  • Members
  • 12 posts
  • LocationUSA

Posted 28 March 2015 - 05:24 PM

It looks to me as if this shouldn't work anymore, I ran peripheral.getType() on both a Capacitor Bank and an Energy Cell. The Capacitor Bank returned "capacitor_bank" and the energy cell returned "powered_tile".

The script looks for "tile_enderio_blockcapacitorbank_name" and "cofh_thermalexpansion_energycell". I don't know if peripherals return more than one type in an array, but if they don't then the types the scripts looks for should never be found and the program should always output "No Energy storage found. Halting script!"

Okay, I fixed it. The easiest way to fix it is to find and replace all instances of "tile_enderio_blockcapacitorbank_name" with "capacitor_bank" and all instances of "cofh_thermalexpansion_energycell" with "powered_tile". There are two instances of each. That is all that's required to make the script work.

However, I'm working on a much improved version of the script that adds support for billions of RF, formats the program to work on 2x3 monitors instead of 1x2 ones, fixes the spacing in the script, and much more.

View Postchanzie, on 13 February 2015 - 01:24 PM, said:

will this also work for mekanism's energy cubes?

No, it won't currently, but I'm revising the script and I'll see about adding support for it. Unless the cubes don't store RF or don't work with OpenPeripheralsIntegration, then it won't be possible.

Update: So I tried it out and Mekanisms Energy Cubes can be read by my script, but there's no way to differentiate them from TE4 Energy Cells, since they have the same peripheral type. This means that the script will connect to and read from Mekanism Energy Cubes, but they don't use RF so I can't officially support them.

Edited by Umaroth, 29 March 2015 - 04:14 AM.


#6 Umaroth

  • Members
  • 12 posts
  • LocationUSA

Posted 29 March 2015 - 04:17 AM

Alright, I finished work on the updated script.

I've uploaded it here: http://pastebin.com/cA2TNNdH

I also uploaded a changelog of all the changes made from this original here: http://pastebin.com/erPf3t4t

The changes made are:

--Updated to work with current peripheral types (as of 1.7.10 and Thermal Expansion 4.0.0RC7 and EnderIO v2.2.8)
--Fixed spacing
--Formatted for 2x3 Monitor instead of 1x2
--Added formatting support for billions of RF
--Separated formatting of Current and Max RF values
--Made placement of RF values dynamic
--Made "of:" placement dynamic, it now places itself over the first digit of the Max value
--Added support for multiple connections to Capacitor Banks and Energy Cells, now accepts as many of each as you can connect to the network
--Added support for multiple monitors, now accepts as many monitors as you can connect to the network
--Added support for both 1x2 and 2x3 monitors with automatic detection and dynamic scaling for each
--Added support for Big Reactors' turbines and reactors. Only supports one of each.
--Added configurable redstone output side.

If you find any bugs or have any update suggestions, please be sure to let me know.

Edited by Umaroth, 30 March 2015 - 03:45 AM.


#7 michaelcampbell229

  • Members
  • 17 posts

Posted 02 December 2015 - 03:45 AM

View PostUmaroth, on 29 March 2015 - 04:17 AM, said:

Alright, I finished work on the updated script.
I've uploaded it here: http://pastebin.com/cA2TNNdH

Nice script, although I have two questions:
1) any way to disable the engines on/off part (I just want it to display the amount of energy)
2) and make a redstone lamp flash when it gets bellow a certain limit?

#8 AyScorch

  • Members
  • 10 posts

Posted 22 February 2020 - 09:27 PM


View PostUmaroth, on 29 March 2015 - 04:17 AM, said:

Alright, I finished work on the updated script.
I've uploaded it here: http://pastebin.com/cA2TNNdH
Hey, I'm running TE4 176 and CC 1.7. I keep on getting a not detected error from my advanced computer. I have a Resonant cell behind the computer, and I don't have any of the expansion mods for CC. Is there any way I could get it to work?

#9 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 22 February 2020 - 09:56 PM

View PostAyScorch, on 22 February 2020 - 09:27 PM, said:

Hey, I'm running TE4 176 and CC 1.7. I keep on getting a not detected error from my advanced computer. I have a Resonant cell behind the computer, and I don't have any of the expansion mods for CC. Is there any way I could get it to work?

You probably need openperipherals: https://openmods.info/

Also, necro posting is not ok.

Edited by Lupus590, 22 February 2020 - 09:56 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users