Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. local build = false;
  2. local placed = 0;
  3. local finishedLine = false;
  4. local wallsBuild = 0;
  5. local slot = 1;
  6. local blocks = 64;
  7. local rowsBuild = 0;
  8. local startRoof = false;
  9. local roofPlaced = 0;
  10. local buildRight = true;
  11. local buildLeft = false;
  12. local roofRow = 0;
  13. local Finished = false;
  14.  
  15. function turtle.buildLine()
  16. turtle.placeDown();
  17. turtle.forward();
  18. blocks = blocks - 1;
  19. placed = placed + 1;
  20. end
  21.  
  22. function turtle.buildRoof()
  23. if roofRow==9 then
  24. Finished = true;
  25. end
  26. if startRoof==false then
  27. turtle.down();
  28. turtle.forward();
  29. turtle.turnLeft();
  30. startRoof = true;
  31. end
  32. if startRoof==true then
  33. if buildRight==true then
  34. if roofPlaced<9 then
  35. turtle.placeDown();
  36. blocks = blocks - 1;
  37. turtle.forward();
  38. roofPlaced = roofPlaced + 1;
  39. end
  40. if roofPlaced==9 then
  41. roofRow = roofRow + 1;
  42. turtle.placeDown();
  43. blocks = blocks - 1;
  44. turtle.turnRight();
  45. turtle.forward();
  46. turtle.turnRight();
  47. roofPlaced = 0;
  48. buildLeft = true;
  49. buildRight = false;
  50. end
  51. end
  52. if buildLeft==true then
  53. if roofPlaced<9 then
  54. turtle.placeDown();
  55. blocks = blocks - 1;
  56. turtle.forward();
  57. roofPlaced = roofPlaced + 1;
  58. end
  59. if roofPlaced==9 then
  60. roofRow = roofRow + 1;
  61. turtle.turnLeft();
  62. turtle.forward();
  63. turtle.turnLeft();
  64. roofPlaced = 0;
  65. buildLeft = false;
  66. buildRight = true;
  67. end
  68. end
  69. end
  70. end
  71.  
  72. while true do
  73. if Finished==false then
  74. if blocks==0 then
  75. blocks = 64;
  76. slot = slot + 1;
  77. turtle.select(slot);
  78. end
  79. if rowsBuild<5 then
  80. if wallsBuild<4 then
  81. if build==false then
  82. turtle.forward();
  83. turtle.up();
  84. build = true;
  85. end
  86. if build==true and placed<10 then
  87. turtle.buildLine();
  88. end
  89. if placed==10 then
  90. finishedLine = true;
  91. wallsBuild = wallsBuild + 1;
  92. end
  93. if finishedLine==true then
  94. turtle.turnLeft();
  95. finishedLine = false;
  96. placed = 0;
  97. end
  98. end
  99. if wallsBuild==4 then
  100. turtle.up();
  101. wallsBuild = 0;
  102. rowsBuild = rowsBuild + 1;
  103. end
  104. end
  105. if rowsBuild==5 then
  106. turtle.buildRoof();
  107. end
  108. end
  109. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement