Skip to content

Instantly share code, notes, and snippets.

@Fingercomp
Created August 31, 2018 14:00
local component = require("component")
local sides = require("sides")
local os = require("os")
local rs = component.redstone
local colors = require("colors")
local gpu = component.gpu
local w, h = gpu.getResolution()
local colorList = {["Creosote"] = colors.brown,
["Lubricant"] = colors.yellow,
["Jet Fuel"] = colors.magenta,
["Water"] = colors.blue,
["Lava"] = colors.red}
while true do
for tankAddress in component.list("tank_controller") do
local tank = component.proxy(tankAddress)
local fluidsInTank = tank.getFluidInTank(sides.top)
for _, fluid in ipairs(fluidsInTank) do
if fluid.capacity - fluid.amount > 1000000 then
rs.setBundledOutput(sides.back, colorList[fluid.label], 15)
gpu.setBackground(colorList[fluid.label])
print(fluid.label .. ": " .. fluid.amount .. "/" .. fluid.capacity)
print("Status: Active")
else
rs.setBundledOutput(sides.back, colorList[fluid.label], 0)
gpu.setBackground(colorList[fluid.label])
print(fluid.label .. ": " .. fluid.amount .. "/" .. fluid.capacity)
print("Status: Standby")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment