Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- smeltery display
- local drain = peripheral.wrap( "tconstruct_smelterydrain_0" )
- term.clear()
- local tankSide = (function()
- for _, direction in ipairs({'north', 'south', 'east', 'west'}) do
- local info = drain.getTankInfo(direction)
- if info and info[1] and info[1].contents then
- return direction
- end
- end
- end)()
- if not tankSide then error("Inner smeltery tanks couldn't be found! Is the smeltery drain attached??", 0) end
- while true do
- term.setCursorPos(1,2)
- term.clear()
- local tank1,tank2,tank3,tank4,tank5,tank6,tank7,tank8,tank9,tank10 = unpack( drain.getTankInfo(tankSide) )
- if not tank1.contents then print("No fluid")
- else print(textutils.serialize(tank1.contents.rawName)," : ",DIV(textutils.serialize(tank1.contents.amount),144)," Ingots" )
- if not tank2.contents then print("No fluid")
- else print(textutils.serialize(tank2.contents.rawName)," : ",DIV(textutils.serialize(tank2.contents.amount),144)," Ingots" )
- if not tank3.contents then print("No fluid")
- else print(textutils.serialize(tank3.contents.rawName)," : ",textutils.serialize(tank3.contents.amount)/144," Ingots" )
- if not tank4.contents then print("No fluid")
- else print(textutils.serialize(tank4.contents.rawName)," : ",textutils.serialize(tank4.contents.amount)/144," Ingots" )
- if not tank5.contents then print("No fluid")
- else print(textutils.serialize(tank5.contents.rawName)," : ",textutils.serialize(tank5.contents.amount)/144," Ingots" )
- if not tank6.contents then print("No fluid")
- else print(textutils.serialize(tank6.contents.rawName)," : ",textutils.serialize(tank6.contents.amount)/144," Ingots" )
- if not tank7.contents then print("No fluid")
- else print(textutils.serialize(tank7.contents.rawName)," : ",textutils.serialize(tank7.contents.amount)/144," Ingots" )
- if not tank8.contents then print("No fluid")
- else print(textutils.serialize(tank8.contents.rawName)," : ",textutils.serialize(tank8.contents.amount)/144," Ingots" )
- if not tank9.contents then print("No fluid")
- else print(textutils.serialize(tank9.contents.rawName)," : ",textutils.serialize(tank9.contents.amount)/144," Ingots" )
- if not tank10.contents then print("No fluid")
- else print(textutils.serialize(tank10.contents.rawName)," : ",textutils.serialize(tank10.contents.amount)/144," Ingots" ) end end end end end end end end end end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment