Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is a block placement program for a turtle that will place a block then move 2 blocks and place another one until it reaches the given length.
- -- Useful for the tops of castle walls or any other situation where you need blocks spaced out.
- -- Written by Richard Reigens 10/12/2013
- -- Version 1.3
- -- Make sure turtle has building blocks and is fueled up.
- -- The program will detect whether there is a block under the turtle or not and start alternating the pattern based on that.
- -- Place your turtle facing the direction you want the line made.
- -- Useage is: merlon <length>
- local tArgs = {...}
- local length = tonumber(tArgs[1])
- local slot = 1
- local space = true
- if turtle.detectDown() == true then
- space = false
- end
- turtle.select(slot)
- putIt = function ()
- if turtle.getItemCount(slot) == 0 then
- slot = slot + 1
- turtle.select(slot)
- turtle.placeDown()
- else
- turtle.placeDown()
- end
- end
- checkSpace = function ()
- if space == true then
- turtle.forward()
- putIt()
- space = false
- else turtle.forward()
- space = true
- end
- end
- for i = 1, length, 1 do
- if i < length then
- checkSpace()
- end
- end
- print("Complete")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement