Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --tunnel10
- --VARIABLES
- --CobblestoneCounter
- cslot = 1
- turtle.select(cslot)
- --FUNCTIONS
- -- Ensure turtle goes up
- function goUp()
- while not turtle.up() do
- upDig()
- end
- end
- --Ensure turtle goes down
- function goDown()
- while not turtle.down() do
- downDig()
- end
- end
- -- Ensure turtle moves forward
- function goForward()
- while not turtle.forward() do
- forwardDig()
- end
- end
- -- Dig forward
- function forwardDig()
- while turtle.detect() do
- turtle.dig()
- end
- end
- -- Dig up
- function upDig()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- -- Dig Down
- function downDig()
- turtle.digDown()
- end
- --Place Cobblestone Below
- function placeCobblestoneDown()
- turtle.select(cslot)
- turtle.placeDown()
- CounterCobblestone()
- end
- --Place Cobblestone Regularly
- function placeCobblestone()
- turtle.select(cslot)
- turtle.place()
- CounterCobblestone()
- end
- --Place Cobblestone Above
- function placeCobblestoneUp()
- turtle.select(cslot)
- turtle.placeUp()
- CounterCobblestone()
- end
- --Counts stacks of cobble
- function CounterCobblestone()
- while turtle.getItemCount(cslot) < 1 do
- cslot = (cslot%13)+1
- end
- end
- --Place Cobblestone Below and then move forward
- function CobbleDForward()
- placeCobblestoneDown()
- goForward()
- end
- --Clearing our 3x1 section for tunnel
- function UpandDown()
- turtle.digUp()
- turtle.digDown()
- end
- -- Variables, X is movement, Y is slot, Z is usage of slot
- x=0
- y=1
- z=0
- turtle.select(y)
- goUp()
- goUp()
- goUp()
- -- We need to build a ceiling to avoid floods
- while x < 10
- if not turtle.detectUp()
- turtle.placeUp()
- goForward()
- z=z+1
- else
- sleep(.1)
- goForward()
- end
- x=x+1
- end
- end
- while x > 0
- turtle.back()
- goDown()
- goDown()
- goDown()
- x=0
- turtle.up()
- while x < 10 do
- goForward()
- UpandDown()
- x +1
- end
- while x > 0 do
- turtle.back()
- end
- turtle.down()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement