Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --turtle builder
- function stopForBricks() --halts the turtle if its out of bricks pending a refill
- print("out of bricks, fill'er up and press c")
- while true do
- local event, character = os.pullEvent()
- if event == "char" and character == "c" then break end
- end
- end
- --main program
- local slotNum = 1
- local sides = 1
- print("length?")
- local length = tonumber(read())
- while length > 5 do
- for i = 1,length do
- if turtle.getItemCount(slotNum) == 0 then
- slotNum = slotNum + 1
- if slotNum == 17 then
- stopForBricks()
- slotNum = 1
- end
- end
- turtle.select(slotNum)
- turtle.placeDown()
- turtle.forward()
- end
- turtle.turnRight()
- sides = sides + 1
- if side == 5 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- length = length - 2
- elseif side == 9 then
- turtle.up()
- side = 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment