I have recently started using ComputerCraft to control my base. I have OpenPeripherals and thermal expansion on it, with more, but these are the mods I'm using together right now.
So I have 14 Resonant Energy Cells from Thermal Expansion to store my energy, and they're all hooked up to wired modems. I am pulling off their energy stored from each cell, so I can monitor my energy network. The problem I have is that with each request, there's a small delay. I remade a very simple code in my test world, which is here:
cells = {"cofh_thermalexpansion_energycell_0", "cofh_thermalexpansion_energycell_1", "cofh_thermalexpansion_energycell_2", "cofh_thermalexpansion_energycell_3", "cofh_thermalexpansion_energycell_4", "cofh_thermalexpansion_energycell_5", "cofh_thermalexpansion_energycell_6", "cofh_thermalexpansion_energycell_7", "cofh_thermalexpansion_energycell_8"}
for i, v in ipairs(cells) do
energy = peripheral.call("back", "callRemote", v, "getEnergyStored", "direction")
print(i..": "..energy)
end
Basically, the script iterates through all the cells and calls the function getEnergyStored from each cell with the peripheral.call() function. Here is a low-FPS gif, which shows the resulting delay:
I tried googling this, and couldn't find anything.
I would like to know if there's a way to not have this delay, as it stops all other interaction with the computer, like keypresses and such. If it's just how it is with the function or modems, a solution I see is to set up another computer, and just have it read the energy, and send it over modems, but if there's a delay there, then it wouldn't matter. I would also like to have it all on one computer.