Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --placing torch with 5 spacec between by default
- --first argument is length of the tunel
- --second is optional, empty spaces between torches
- local args = {...}
- if args[1] == nil then
- print("Too little arguments.\n")
- return
- end
- local distance = 0
- if args[2] == nil then
- print("Default distance of 5.\n")
- distance = 6
- else
- print("Distance of "..args[2].." set.\n")
- distance = args[2] + 1
- end
- local length = args[1]
- turtle.select(1)
- for i = 1, length do
- print("\t"..(i - 1).."%"..distance.."="..(i-1)%distance.."\n")
- if ((i - 1)%distance) == 0 then
- print("\t\tPlacing torch.\n")
- turtle.placeUp()
- end
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement