Flux Network x CC: Tweaked
Functionality:
- Monitor and manage energy in your Flux Network through computers
- Get complete network statistics and energy indicators
- Ability to output data to monitors and terminal
Technical Features: The modification provides a unified interface for interaction between Flux Network and the Computer Craft: Tweaked mod. You can easily find Flux controllers via peripheral devices, read main network parameters and display them in a convenient way.
Usage Example:
local flux = peripheral.find("flux_controller") -- Find Flux controller
local monitor = peripheral.find("monitor") -- Find monitor
monitor.clear() -- Clear monitor
local line = 0 -- Starting position
local function write(toWrite, color)
line = line + 1
-- If color parameter not specified, use white
if color == nil then
color = 0x1 -- this is white
end
monitor.setTextColor(color)
monitor.setCursorPos(1, line)
monitor.write(toWrite)
monitor.setTextColor(0x1)
end
-- Formats numbers from 194168 to 194,168
local function format_number(n)
local formatted = tostring(n)
local k
while true do
formatted, k = formatted:gsub("^(-?%d+)(%d%d%d)", '%1,%2')
if k == 0 then break end
end
return formatted
end
while true do
local stats = flux.networkStats()
write(format_number(flux.getEnergy()) .. " / " .. format_number(flux.getEnergyCapacity()) .. " FE")
write()
write("Controllers: ".. stats.controllerCount)
write("Points: ".. stats.pointCount)
write("Storages: ".. stats.storageCount)
write("Buffer: ".. stats.totalBuffer)
write("Total Energy: ".. stats.totalEnergy)
write("Energy Input: ".. stats.energyInput)
write("Energy Output: ".. stats.energyOutput)
write("Average Tick: ".. stats.averageTick)
write("Connection Count: ".. stats.connectionCount)
line = 0 -- reset line counter. Handled in write function
end
Plans: The mod will be updated for new Minecraft versions after implementing basic functionality.
Compatibility: Works with modpacks of any configuration.