Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local z = 0
- local function smartForward()
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- turtle.digUp()
- z = z+1
- end
- local function smartForwardNo()
- turtle.placeDown()
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- end
- local function smartTorch()
- while not turtle.placeUp() do
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- end
- local function torch()
- if z % 8 == 0 then
- turtle.digUp()
- turtle.turnLeft()
- turtle.up()
- turtle.place()
- turtle.down()
- turtle.placeDown()
- turtle.select(16)
- smartTorch()
- turtle.turnRight()
- turtle.select(1)
- end
- end
- print("How Far?")
- x = read()
- y = tonumber(x)
- tunnel = 0
- while true do
- for all = 1, y do
- smartForward()
- torch()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1, y do
- smartForwardNo()
- end
- tempvar = tunnel*3
- tunnel=tunnel+1
- turtle.turnRight()
- for i = 1, tempvar do
- smartForwardNo()
- end
- for j = 2, 15 do
- turtle.select(j)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i=1, tempvar do
- smartForwardNo()
- end
- smartForwardNo()
- turtle.digUp()
- smartForwardNo()
- turtle.digUp
- smartForwardNo()
- turtle.digUp()
- turtle.turnLeft()
- z = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment