Advertisement
Guest User

tank

a guest
Jun 26th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. rednet.open("top")
  2. function giveTankAmount()
  3.    local s,m = rednet.receive()
  4.    if s == 4 then
  5.       local tank = peripheral.wrap("left")
  6.       local x = tank.getTankInfo()
  7.       local x = x[1]
  8.       local x = x.contents.amount
  9.       rednet.send(s,x)
  10.       return s
  11.    else
  12.       rednet.send(s, "denied")
  13.    end
  14. end
  15. local a = true
  16. repeat
  17.    local b = giveTankAmount()
  18.    print("Request from #"..b)
  19. until a == false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement