Advertisement
Guest User

asdf

a guest
Feb 11th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. local tank = peripheral.wrap("left")
  2. local tankVolume = tank.getTankInfo()[1].capacity
  3. local volumeThreshold = 60000
  4.  
  5. rednet.open("top")
  6.  
  7. while true do
  8. os.sleep(1)
  9.  
  10. local contents = tank.getTankInfo()[1].contents
  11.  
  12. if contents ~= nil then
  13. if contents.amount < (tankVolume - volumeThreshold) then
  14. rednet.broadcast("xp30")
  15. print("meow")
  16. end
  17. else
  18. rednet.broadcast("xp30")
  19. print("Oh shit the tank is empty :(")
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement