Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local length = 0
- local width = 0
- turtle.select(1)
- print("How long do you want the tunnel?")
- length = io.read()
- print("How wide do you want the tunnel?")
- width = io.read()
- length = tonumber(length)
- width = tonumber(width)
- for h=1, width do
- for i=1, length-2 do
- if i < length then
- turtle.dig()
- turtle.forward()
- end
- if turtle.detectUp() then
- turtle.digUp()
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- if (turtle.getItemCount(16) >= 1) then --Drop items into a chest
- turtle.select(3)
- turtle.placeDown()
- for slot=4, 16 do
- turtle.select(slot)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- if (h==1 or h%4==0) then --Place a torch
- if i%8==0 then
- turtle.select(2)
- turtle.placeDown()
- turtle.select(1)
- end
- end
- if (turtle.getFuelLevel() <= 1) then
- turtle.refuel(1)
- end
- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- if h%2==0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- if h%2==0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
Add Comment
Please, Sign In to add comment