Farrk

TANKS_liquidamount

Dec 18th, 2013
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. --theoriginalbit's 1.5.2-1.6.4 compatible function for checking liquid amount
  2. local function getLiquidAmount(side, tankSide)
  3. local p = peripheral.wrap(side or "top")
  4. local getTankInfo = p.getTanks or p.getTankInfo
  5. local tankInfo = getTankInfo(tankSide or "unknown")
  6. local _,tank = next(tankInfo)
  7. return type(tank) == "table" and tank.amount or nil
  8. end
Advertisement
Add Comment
Please, Sign In to add comment