Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tank = peripheral.wrap('bottom')
- monitor = peripheral.wrap('back')
- monitor.clear()
- term.redirect(monitor)
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setCursorPos(3, 1)
- term.write("Tank Monitoring System")
- term.setCursorPos(3, 3)
- term.write("Liquid:")
- term.setCursorPos(3, 5)
- term.write("Amount:")
- term.setCursorPos(3, 7)
- term.write("Capacity:")
- while true do
- term.setCursorPos(15, 3)
- term.write(tank.getTankInfo()[1].contents.rawName)
- term.setCursorPos(15, 5)
- term.write(tank.getTankInfo()[1].contents.amount)
- term.setCursorPos(15, 7)
- term.write(tank.getTankInfo()[1].capacity)
- percent = tank.getTankInfo()[1].contents.amount / tank.getTankInfo()[1].capacity * 45
- paintutils.drawBox(3, 9, 48, 10, colors.red)
- paintutils.drawBox(3, 9, 3 + percent, 10, colors.green)
- term.setBackgroundColor(colors.black)
- end
Add Comment
Please, Sign In to add comment