Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local size = 4
- local height = 0
- local function unload()
- print( "Unloading items..." )
- for n=2, 16 do
- turtle.select(n)
- turtle.drop()
- end
- turtle.select(1)
- end
- local function done()
- if size == 1 then
- for i=height, 1, -1 do
- turtle.down()
- end
- turtle.back()
- turtle.turnLeft()
- turtle.turnLeft()
- unload()
- turtle.turnLeft()
- turtle.turnLeft()
- else
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- unload()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- -- Check for fuel (use charcoal in first slot)
- local fuelLevel = turtle.getFuelLevel()
- if fuelLevel == "unlimited" then
- return true
- elseif fuelLevel < 96 then
- turtle.refuel(1)
- end
- -- Start the harvest
- turtle.dig()
- turtle.forward()
- if size == 1 then
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- height = height + 1
- end
- done()
- else
- turtle.dig()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- turtle.dig()
- height = height + 1
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- for i=height, 1, -1 do
- turtle.digDown()
- turtle.down()
- turtle.dig()
- end
- done()
- end
Advertisement
Add Comment
Please, Sign In to add comment