Advertisement
Guest User

makeFloor

a guest
May 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. local x, y = ...
  2.  
  3. xPos, yPos = 0, 0
  4. turtle.select(1)
  5.  
  6. while xPos < tonumber(x) do
  7.   if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  8.     for i = 2, 16 do
  9.       turtle.select(i)
  10.       turtle.transferTo(i - 1)
  11.     end
  12.     turtle.select(1)
  13.   end
  14.  
  15.   turtle.digDown()
  16.   turtle.placeDown(1)
  17.    
  18.   if yPos < tonumber(y) - 1 then
  19.     turtle.forward()
  20.     yPos = yPos + 1
  21.   elseif xPos < tonumber(x) then
  22.     if math.fmod(xPos, 2) == 0 then
  23.       turtle.turnLeft()
  24.       turtle.forward()
  25.       turtle.turnLeft()
  26.     else
  27.       turtle.turnRight()
  28.       turtle.forward()
  29.       turtle.turnRight()
  30.     end
  31.    
  32.     xPos = xPos + 1
  33.     yPos = 0
  34.   end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement