Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = {...}
- local tunnelDistance = 1
- local traveled = 0
- if arg[1] then
- tunnelDistance = tonumber(arg[1])
- else
- while true do
- term.write("How long should I tunnel for?")
- tunnelDistance = tonumber(read())
- if tunnelDistance then
- break
- end
- print("Cannot Compute")
- end
- end
- while true do
- if not turtle.detect() then
- turtle.forward()
- traveled = traveled + 1
- else
- break
- end
- end
- if tunnelDistance == 1 then
- tunnelDistance = 2
- end
- shell.run("tunnel", tunnelDistance + 1)
- shell.run("turn", "right", "2")
- shell.run("go","forward", tunnelDistance + traveled )
- shell.run("turn", "right", "2")
Advertisement
Add Comment
Please, Sign In to add comment