Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle utility program to cover holes or build floors in pits (I make pits)
- -- v1.0 20140803a first draft, room for improvement
- -- floor material in second slot
- -- position on left side of room
- flip=0
- slot=3
- turtle.select(2)
- turtle.forward()
- while not turtle.detectDown() do
- while turtle.getItemCount(2)<1 and slot<16 do
- turtle.select(slot)
- turtle.transferTo(2)
- slot=slot+1
- turtle.select(2)
- end
- -- if turtle runs out, it should have x,y
- -- offset to return to start at this point
- turtle.placeDown()
- if turtle.detect() then
- turtle.turnRight()
- end
- turtle.forward()
- if turtle.detectDown() then
- if flip==0 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- flip=1
- elseif flip==1 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- flip=0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement