blackrabt

Liquid Tank % Measure

Mar 7th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local tank = peripheral.wrap("drum_0")
  2. local info = tank.getTankInfo("unknown")
  3.  
  4. -- prints information >>
  5. print(textutils.serialize(info))
  6. print(info[1]["contents"]["amount"])
  7.  
  8. while true do
  9.   info = tank.getTankInfo("unknown")
  10.     if (info[1]["contents"]["amount"]) / (info[1]["capacity"]) < (0.8) then
  11.       rs.setOutput("top", true)
  12.     else
  13.       rs.setOutput("top", false)
  14.     end
  15.   sleep(5)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment