Advertisement
Guest User

flooring

a guest
Aug 3rd, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. -- floor material in second slot
  2. -- position on left side of room
  3.  
  4. flip=0
  5. slot=3
  6. turtle.select(2)
  7. turtle.forward()
  8.  
  9. while not turtle.detectDown() do
  10.   while turtle.getItemCount(2)<1 and slot<16 do
  11.     turtle.select(slot)
  12.     turtle.transferTo(2)
  13.     slot=slot+1
  14.     turtle.select(2)
  15.   end
  16.  
  17. -- if turtle runs out, it should have x,y
  18. -- offset to return to start at this point
  19.  
  20.     turtle.placeDown()
  21.   if turtle.detect() then
  22.     turtle.turnRight()
  23.   end
  24.   turtle.forward()
  25.   if turtle.detectDown() then
  26.     if flip==0 then
  27.       turtle.turnRight()
  28.       turtle.forward()
  29.       turtle.turnRight()
  30.       turtle.forward()
  31.       flip=1
  32.     elseif flip==1 then
  33.       turtle.turnLeft()
  34.       turtle.forward()
  35.       turtle.turnLeft()
  36.       turtle.forward()
  37.       flip=0
  38.     end
  39.   end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement