Advertisement
maxtorcd55

tank cap

Apr 5th, 2014
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. p = peripheral.wrap("top")
  2. t = p.getNamesRemote()
  3.  
  4. for i = 1, #t do
  5.     if string.find(string.lower(t[i]), "tank") then
  6.         data = p.callRemote(t[i], "getTankInfo","")
  7.         if (data[1]["rawName"] ~= nil) and (data[1]["amount"] ~= nil) and (data[1]["capacity"] ~= nil) then
  8.             print(data[1]["rawName"]..": "..data[1]["amount"].."/"..data[1]["capacity"])
  9.         end
  10.     end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement