Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require"component"
- local sides = require"sides"
- local tank = component.tank_controller
- --Fill level and capacity
- tfillN = tank.getTankLevel(sides.north)
- tcapN = tank.getTankCapacity(sides.north)
- --Percentage
- tpercN = (tfillN / tcapN) * 100
- --Readability
- tpercN = math.floor(tpercN)
- print("der Tank ist zu "..tpercN.."% gefuellt")
- --Get label
- tanks = {} --Why?!
- for a,b in ipairs(tank.getFluidInTank(sides.north))
- do
- tanks[a] = {}
- tanks[a].name = b.name
- tanks[a].label = b.label
- tanks[a].unit = b.unit
- tanks[a].level = b.amount
- tanks[a].capacity = b.capacity
- tlabelN = b.label
- end
- print("Fluessigkeit: "..tlabelN)
Add Comment
Please, Sign In to add comment