kilarn123

Untitled

Dec 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. -- smeltery display
  2.  
  3. local drain = peripheral.wrap( "tconstruct_smelterydrain_0" )
  4. term.clear()
  5.  
  6. local tankSide = (function()
  7. for _, direction in ipairs({'north', 'south', 'east', 'west'}) do
  8. local info = drain.getTankInfo(direction)
  9. if info and info[1] and info[1].contents then
  10. return direction
  11. end
  12. end
  13. end)()
  14.  
  15. if not tankSide then error("Inner smeltery tanks couldn't be found! Is the smeltery drain attached??", 0) end
  16.  
  17. while true do
  18. term.setCursorPos(1,2)
  19. term.clear()
  20. local tank1,tank2,tank3,tank4,tank5,tank6,tank7,tank8,tank9,tank10 = unpack( drain.getTankInfo(tankSide) )
  21.  
  22. if not tank1.contents then print("No fluid")
  23. else print(textutils.serialize(tank1.contents.rawName)," : ",DIV(textutils.serialize(tank1.contents.amount),144)," Ingots" )
  24. if not tank2.contents then print("No fluid")
  25. else print(textutils.serialize(tank2.contents.rawName)," : ",DIV(textutils.serialize(tank2.contents.amount),144)," Ingots" )
  26. if not tank3.contents then print("No fluid")
  27. else print(textutils.serialize(tank3.contents.rawName)," : ",textutils.serialize(tank3.contents.amount)/144," Ingots" )
  28. if not tank4.contents then print("No fluid")
  29. else print(textutils.serialize(tank4.contents.rawName)," : ",textutils.serialize(tank4.contents.amount)/144," Ingots" )
  30. if not tank5.contents then print("No fluid")
  31. else print(textutils.serialize(tank5.contents.rawName)," : ",textutils.serialize(tank5.contents.amount)/144," Ingots" )
  32. if not tank6.contents then print("No fluid")
  33. else print(textutils.serialize(tank6.contents.rawName)," : ",textutils.serialize(tank6.contents.amount)/144," Ingots" )
  34. if not tank7.contents then print("No fluid")
  35. else print(textutils.serialize(tank7.contents.rawName)," : ",textutils.serialize(tank7.contents.amount)/144," Ingots" )
  36. if not tank8.contents then print("No fluid")
  37. else print(textutils.serialize(tank8.contents.rawName)," : ",textutils.serialize(tank8.contents.amount)/144," Ingots" )
  38. if not tank9.contents then print("No fluid")
  39. else print(textutils.serialize(tank9.contents.rawName)," : ",textutils.serialize(tank9.contents.amount)/144," Ingots" )
  40. if not tank10.contents then print("No fluid")
  41. else print(textutils.serialize(tank10.contents.rawName)," : ",textutils.serialize(tank10.contents.amount)/144," Ingots" ) end end end end end end end end end end
  42.  
  43. sleep(1)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment