Advertisement
Fox_k

Turtle Build Floor

Aug 18th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. local howfar = {...}
  2. local passaorb = 1
  3. if #howfar ~= 2 then
  4.         print("Usage: Program-Name ### #")
  5.         print("This program makes a floor below it.")
  6.         return
  7. end
  8.  
  9. print("Placing blocks "..howfar[1].." blocks ahead.")
  10.  
  11. j = 1
  12.  
  13. for a = 1, howfar[2] do
  14.  
  15.     for b = 1, howfar[1] do
  16.        
  17.         if turtle.getItemCount(j) > 0 then
  18.             turtle.select(j)
  19.             turtle.placeDown(j)
  20.         else
  21.             j = j + 1
  22.             turtle.select(j)
  23.             turtle.placeDown(j)
  24.         end
  25.        
  26.         turtle.forward()
  27.        
  28.     end
  29.  
  30.     if (a % 2) == 0 then
  31.         turtle.turnLeft()
  32.         turtle.forward()
  33.         turtle.turnLeft()
  34.     else
  35.         turtle.turnRight()
  36.         turtle.forward()
  37.         turtle.turnRight()
  38.      end
  39.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement