gur111 icon

Untitled

gur111 | PRO | 11/06/17 07:40:31 PM UTC | 0 ⭐ | 546 👁️ | Never ⏰ | []
Lua |

580 B

|

None

|

0 👍

/

0 👎

local tArgs = {...}
if(#tArgs ~= 3) then
    print("Usage: doTunnel <length> <amount> <spacing>")
end
 
function go()
    turtle.digDown()
    turtle.dig()
    turtle.digUp()
    turtle.forward()
end
 
function tunnel(amount)
    for i=0,amount do
        go()
    end
end
local size,inter, times
size = tArgs[1]
inter = tArgs[3]
times = tArgs[2]
for i=0,times do
    tunnel(size)
    turtle.turnLeft()
    tunnel(inter)
    turtle.turnLeft()
    tunnel(size)
    turtle.turnRight()
    tunnel(inter)
    turtle.turnRight()
end
turtle.turnRight()
tunnel(size*(2+inter))

Comments