Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local term = require("term")
- local keyboard = require("keyboard")
- local tc = component.tank_controller
- local rs = component.redstone
- local INGOT_MB = 144
- local BLOCK_MB = 1296
- -- local info = tc.getFluidInTank(sides.south)
- -- term.clear()
- while true do
- -- stop the program by pressing Shift
- if keyboard.isShiftDown() then
- break
- end
- local info = tc.getFluidInTank(sides.south)
- local amount = info[1].amount
- term.clear()
- -- term.setCursor(1, 1)
- print("Fluid amount: " .. amount)
- local blocks = math.floor(amount/BLOCK_MB)
- print("Blocks: " .. blocks)
- local ingots = math.floor(amount/INGOT_MB)
- print("Ingots: " .. ingots)
- if blocks > 0 then -- pouring blocks
- rs.setOutput(sides.east, blocks)
- os.sleep(0.2)
- rs.setOutput(sides.east, 0)
- os.sleep(30) -- blocks cooldown
- elseif ingots > 0 then -- pouring ingots
- rs.setOutput(sides.west, ingots)
- os.sleep(0.2)
- rs.setOutput(sides.west, 0)
- os.sleep(3) -- cooling ingots
- else
- rs.setOutput(sides.west, 0)
- end
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement