Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inputSide = "bottom"
- local outputSide = "left"
- local tank = peripheral.wrap("right")
- while true do
- -- start only if redstone signal is applied
- if redstone.getInput(inputSide) then
- print("DRAINING COW")
- end
- while redstone.getInput(inputSide) do
- if turtle.place() then
- if not tank.unpack() then
- turtle.turnLeft()
- turtle.turnLeft()
- shell.run("redpulse "..outputSide)
- print()
- while tank.drop() < 1000 do
- print("TANK FULL")
- sleep(5)
- end
- tank.unpack()
- while not tank.drop() < 1000 do
- print("TANK FULL")
- sleep(5)
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- sleep(0.5)
- else
- print("WAITING FOR COW")
- sleep(10)
- end
- end
- print("STOPPED DRAINING COW")
- os.pullEvent("redstone")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement