tarnovsky

Home Builder

Jan 10th, 2024 (edited)
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. print ("Enter length")
  2. local input = read()
  3. local length = input
  4.  
  5. print ("Enter width (right) ")
  6. local input = read()
  7. local width = input
  8.  
  9. print ("Enter number of block stacks ")
  10. local input = read()
  11. local stacks = input
  12.  
  13. local answer= "y"
  14. print ("floor y/n")
  15. local input = read()
  16. local turn = false
  17. local z = 0
  18. local block = 1
  19. if input == answer
  20. then
  21.     for x = 0,width,1
  22.     do
  23.         for y = 0,length,1
  24.         do
  25.             turtle.digDown()
  26.             turtle.placeDown()
  27.             z = z + 1
  28.             if z == 64
  29.             then
  30.                 block = block + 1
  31.                 if block == stacks + 1
  32.                 then
  33.                     print ("Insert more blocks")
  34.                     local input = read()
  35.                     block = 1
  36.                 end
  37.                 turtle.select(block)
  38.                 z = 0
  39.             end
  40.             turtle.forward()
  41.         end
  42.         if turn == false
  43.         then
  44.             turtle.turnRight()
  45.             turtle.forward()
  46.             turtle.turnRight()
  47.             turtle.forward()
  48.             turn = true
  49.         else
  50.             turtle.turnLeft()
  51.             turtle.forward()
  52.             turtle.turnLeft()
  53.             turtle.forward()
  54.             turn = false
  55.         end
  56.     end
  57. else
  58.     print("No floor")
  59. end
Advertisement
Add Comment
Please, Sign In to add comment