Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Getting the variables
- local tArgs = { ... }
- if #tArgs < 1 then
- print("Usage: branch <length> <torches>")
- return true
- end
- steps = tonumber(tArgs[1])
- if #tArgs >= 2 and tArgs[2] == "nt" then
- torch = false
- else
- torch = true
- end
- --Starting the dig
- for x = 1, steps do
- if not turtle.forward() then
- repeat
- turtle.dig()
- sleep(0.6)
- until turtle.forward()
- end
- end
- --Getting into position for the return
- turtle.digUp()
- turtle.up()
- turtle.turnRight()
- turtle.turnRight()
- --Starting the return
- for x = 1, steps do
- if torch and x % 8 == 0 then
- turtle.placeDown()
- end
- if not turtle.forward() then
- repeat
- turtle.dig()
- sleep(0.25)
- until turtle.forward()
- end
- end
Add Comment
Please, Sign In to add comment