Advertisement
JMANN2400

WallMaker

Aug 2nd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1.  
  2.  
  3.  
  4. x = 0
  5.  
  6. y = 0
  7.  
  8. slot = 1
  9.  
  10. function selectSlot()
  11.     if turtle.getItemCount(slot) == 0 then
  12.         slot = slot + 1
  13.     end
  14.     turtle.select(slot)
  15. end
  16.  
  17. function column()
  18.     selectSlot()
  19.     turtle.dig()
  20.     turtle.place()
  21.     while y < h - 1 do
  22.         turtle.up()
  23.         y = y + 1
  24.         turtle.dig()
  25.         turtle.place()
  26.     end
  27.     while y > 0 do
  28.         turtle.down()
  29.         y = y - 1
  30.     end
  31. end
  32.  
  33.  
  34.  
  35. print("+-------------------------------------+")
  36. print("| Wall Maker                          |")
  37. print("+-------------------------------------+")
  38. print("| Slot 16: Fuel                       |")
  39. print("| Slot 1-15: Blocks                   |")
  40. print("+-------------------------------------+")
  41. print("| Place turtle at bottom left of the  |")
  42. print("| wall. Specify width and height.     |")
  43. print("| Press enter to start.               |")
  44. print("+-------------------------------------+")
  45. read()
  46. print("+-------------------------------------+")
  47. print("| Wall Width = ?                      |")
  48. print("+-------------------------------------+")
  49. w = tonumber(read())
  50. print("+-------------------------------------+")
  51. print("| Wall height = ?                     |")
  52. print("+-------------------------------------+")
  53. h = tonumber(read())
  54. column()
  55. for i = 1,w - 1,1 do
  56.     turtle.turnRight()
  57.     turtle.forward()
  58.     x = x + 1
  59.     turtle.turnLeft()
  60.     column()
  61. end
  62. turtle.turnLeft()
  63. for i = 1,w - 1,1 do
  64.     turtle.forward()
  65.     x = x - 1
  66. end
  67. turtle.turnRight()
  68. print("Done! :D")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement