zootsuitman

floor place

Apr 28th, 2019
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local selectedSlot = 1
  2. local first = true
  3.  
  4. while true do
  5.     if not first then
  6.         local forward = turtle.detect()
  7.         local down = turtle.detectDown()
  8.  
  9.         if turtle.getItemCount(selectedSlot) == 0 then
  10.             selectedSlot = selectedSlot + 1
  11.         end
  12.  
  13.         if down then
  14.             turtle.back()
  15.             turtle.turnRight()
  16.             turtle.forward()
  17.         end
  18.         elseif forward then turtle.turnRight()
  19.         elseif not forward and not down then
  20.             turtle.placeDown()
  21.             turtle.forward()
  22.         end
  23.     else first = false
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment