SHOW:
|
|
- or go back to the newest paste.
| 1 | local tankSide = "left" | |
| 2 | local slot = 1 | |
| 3 | local signalSide = "top" | |
| 4 | ||
| 5 | local tank = peripheral.wrap(tankSide) | |
| 6 | ||
| 7 | while true do | |
| 8 | local data = tank.getTankInfo("UNKNOWN")[slot]
| |
| 9 | - | local name = data.name |
| 9 | + | local name = data.contents.name |
| 10 | - | local amount = data.amount |
| 10 | + | local amount = data.contents.amount |
| 11 | local capacity = data.capacity | |
| 12 | print("------------------------------")
| |
| 13 | print("name : "..name)
| |
| 14 | if amount > capacity * 75 / 100 then | |
| 15 | term.setTextColor(colors.red) | |
| 16 | rs.setOutput(signalSide,true) | |
| 17 | else | |
| 18 | term.setTextColor(colors.green) | |
| 19 | rs.setOutput(signalSide,false) | |
| 20 | end | |
| 21 | print("amount : "..amount.." / "..capacity)
| |
| 22 | term.setTextColor(colors.white) | |
| 23 | ||
| 24 | sleep(16) | |
| 25 | end |