Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local selection = 1
- turtle.select(selection)
- function tryForward()
- if ( turtle.forward() == false ) then
- print("Get out of my way!!")
- while ( turtle.forward() == false ) do
- os.sleep(2)
- end
- end
- end
- function selectBlock()
- if ( selection == 16 ) then return end
- while ( turtle.getItemCount(selection) <= 0 ) do
- if ( selection == 16 ) then return end
- selection = selection + 1
- turtle.select(selection)
- end
- end
- function DropBlock()
- selectBlock()
- turtle.placeDown()
- end
- local left,right = 1,2
- local turn = left
- function doTurn()
- if ( turn == left ) then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- function switchTurn()
- if ( turn == left ) then
- turn = right
- else
- turn = left
- end
- end
- if ( turtle.detectDown() ) then turtle.forward() end
- while ( turtle.detectDown() == false ) do
- -- do a row
- while ( turtle.detectDown() == false ) do
- DropBlock()
- tryForward()
- end
- doTurn()
- turtle.forward()
- doTurn()
- turtle.forward()
- switchTurn()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement