Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lamps = {
- [1] = peripheral.wrap("glowstone_illuminator_0"),
- [2] = peripheral.wrap("glowstone_illuminator_1"),
- [3] = peripheral.wrap("glowstone_illuminator_2"),
- [4] = peripheral.wrap("glowstone_illuminator_3"),
- [5] = peripheral.wrap("glowstone_illuminator_4"),
- [6] = peripheral.wrap("glowstone_illuminator_5"),
- [7] = peripheral.wrap("glowstone_illuminator_7"),
- [8] = peripheral.wrap("glowstone_illuminator_8"),
- [9] = peripheral.wrap("glowstone_illuminator_9"),
- [10] = peripheral.wrap("glowstone_illuminator_10")
- }
- local tank = peripheral.wrap("back")
- local tankinfo = tank.getTanks("unknown")
- --print(textutils.serialize(tankinfo))
- local percentage = tankinfo[1].amount / tankinfo[1].capacity * 100
- for key,value in pairs(lamps) do
- value.setColor(0x000000)
- end
- while true do
- for i=1,10,1 do
- lamp = lamps[i]
- if (percentage > ((i - 1) * 10)) then
- lamp.setColor(0xFF0000)
- else
- lamp.setColor(0xFFFFFF)
- end
- end
- print(percentage)
- os.sleep(1)
- tankinfo = tank.getTanks("unknown")
- percentage = tankinfo[1].amount / tankinfo[1].capacity * 100
- end
Advertisement
Add Comment
Please, Sign In to add comment