Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function forward(n)
- for i=1,n do
- if turtle.detect() then
- repeat
- turtle.dig()
- until not turtle.detect()
- end
- turtle.forward()
- end
- end
- function place()
- if turtle.detect() then
- turtle.digDown()
- end
- turtle.placeDown()
- end
- function markers(w,h)
- turtle.turnLeft()
- forward(w/2)
- place()
- turtle.turnRight()
- forward(h)
- place()
- turtle.turnRight()
- forward(w)
- place()
- turtle.turnRight()
- forward(h)
- place()
- turtle.turnRight()
- forward(w/2)
- end
- local args = {...}
- if #args==0 then
- print("Usage: markers w [h]")
- return
- end
- local w,h
- if #args==1 then
- w = tonumber(args[1])
- h = w
- else
- w = tonumber(args[1])
- h = tonumber(args[2])
- end
- markers(w,h)
Advertisement
Add Comment
Please, Sign In to add comment