Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- term = require("term")
- local sleepTime = 0.5
- sides = require("sides")
- colors = require("colors")
- rs = component.redstone
- tank = component.tank_controller
- while true do
- tInfo = tank.getFluidInTank(sides.west) -- Tank is above the Adapter
- amount = tInfo[1].amount
- capacity = tInfo[1].capacity
- label = tInfo[1].label
- percent = (tInfo[1].amount / tInfo[1].capacity) * 100
- percent = math.floor(percent + 0.5) --lua's functions do not modify their arguments!
- if percent == 100 then
- rs.setBundledOutput(sides.up,colors.white,255)
- else
- rs.setBundledOutput(sides.up,colors.white,0)
- end
- if percent < 95 then
- rs.setBundledOutput(sides.up,colors.purple,255)
- else
- rs.setBundledOutput(sides.up,colors.purple,0)
- end
- term.clear()
- print("Fuel Type: "..label)
- print("Amount : "..amount)
- print("Tank Cap.: "..capacity)
- print("% Full : "..percent)
- os.sleep(2)
- os.sleep(sleepTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement