jonassvensson4

Tank computer

Nov 1st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tank  = peripheral.wrap("back")
  2. info  = tank.getTankInfo()
  3. cap   = info[1]["capacity"]
  4. name  = info[1]["contents"]["name"]
  5. mb    = info[1]["contents"]["amount"]
  6. b     = mb / 1000
  7. perc  = math.floor(mb * 100 / cap)
  8.  
  9. modem   = "top"
  10. monitor = 40
  11.  
  12. toMon = {cap, name, mb, b, perc}
  13.  
  14. rednet.open(modem)
  15.  
  16. while true do
  17.   rednet.send(monitor,toMon)   
  18.   sleep(300)
  19. end
Add Comment
Please, Sign In to add comment