This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
untoldforce's profile picture

Mixed Mekanism (Joules) and RF monitoring

Started by untoldforce, 18 April 2016 - 05:16 PM
untoldforce #1
Posted 18 April 2016 - 07:16 PM
Hello everyone, I'm trying to write a program which will allow me to keep track of total energy as well as energy usage. As many of you are aware, Mekanism reports usage in Joules which (by default) 1 J = 2.5 RF (redstone flux, which is the energy unit that pretty much everything else but IC2 and Rotarycraft uses). The issue really comes together when polling my storage banks. I don't know of a way to identify Mekanism energy banks automatically. I could hard-code in every Mekanism energy bank that I have connected, but I'm sure there is an easier way… I just don't know it! Please help =)

I am using Wired Modems to attach to both the Mekanism Induction Matrix and Draconic Evolution energy core.

Summary:
Computercraft program monitoring energy banks

Energy banks connected:
EnderIO capacitor banks (uses RF, working, no issues)
Draconic Evolution banks (uses RF, working, no issues)
Mekanism Induction Matrix (uses Joules, working, but reporting incorrect numbers in this mixed environment)
Lupus590 #2
Posted 18 April 2016 - 08:46 PM
You may be aware that wrapped peripherals return as a table, we can use this in two ways.

The first is by looking for keys which are unique to your peripheral (i.e. a function which is not available in one peripheral but is on the others).

The second way is to create a unique key to identify the peripheral immediately after you wrap it (you generally know what you wrap when you wrap it) (i.e. peripheralTable.type = "EnderIO" )
Edited on 18 April 2016 - 06:47 PM
Bomb Bloke #3
Posted 19 April 2016 - 12:46 AM
Or, presumably Mechanism banks have their own unique peripheral type? I can only sort of guess, without seeing your code.