Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drain = peripheral.wrap("back")
- function on(side,time)
- redstone.setOutput(side,true)
- sleep(1)
- redstone.setOutput(side,false)
- sleep(time-1)
- end
- function getQuantity(drainObject)
- local tank = drainObject.getTankInfo()[1]
- local contentsTable = tank["contents"]
- quantity = contentsTable["amount"]
- return quantity
- end
- local ingotVol = 1296 --volume of a full ingot in mB
- local smallIngotVol = 143
- while true do
- if getQuantity(drain) > ingotVol then
- print("Contents is: "..getQuantity(drain))
- on("back",15)
- print("Contents is now: "..getQuantity(drain))
- elseif getQuantity(drain) > smallIngotVol then
- on("right",5)
- else
- print("Quantity is less than 1 block")
- sleep(15)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement