Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --turtle builder
- function stopForBricks()
- 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 turnDirection = 1 --where 1 is right and 2 is left
- print("length?")
- local length = read()
- while true 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
- if turnDirection == 1 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turnDirection = 2
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turnDirection = 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment