aPisC

r16 circle

Apr 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. function forward()
  2. refuel();
  3. while turtle.detect() do
  4. turtle.dig()
  5. end
  6. turtle.forward()
  7. end
  8.  
  9. function up()
  10. refuel();
  11. while turtle.detectUp() do
  12. turtle.digUp()
  13. end
  14. turtle.up()
  15. end
  16.  
  17. function selectSlot()
  18. while turtle.getItemSpace() == 64 do
  19. emptySlot = true;
  20. for i=1, 15 do
  21. if emptySlot then
  22. turtle.select(i)
  23. emptySlot = turtle.getItemSpace() == 64
  24. end
  25. end
  26. end
  27. end
  28.  
  29. function refuel()
  30. while turtle.getFuelLevel() == 0 do
  31. turtle.select(16)
  32. turtle.refuel()
  33. end
  34. turtle.select(1)
  35. selectSlot()
  36. end
  37.  
  38. function placeDown()
  39. while turtle.detectDown() do
  40. turtle.digDown()
  41. end
  42. selectSlot()
  43. turtle.placeDown()
  44. end
  45.  
  46. function unp()
  47. up()
  48. p()
  49. end
  50.  
  51. function fnp()
  52. forward()
  53. p()
  54. end
  55.  
  56. function f()
  57. forward()
  58. end
  59.  
  60. function r()
  61. turtle.turnRight()
  62. end
  63.  
  64. function l()
  65. turtle.turnLeft()
  66. end
  67.  
  68. function rfl()
  69. r()
  70. f()
  71. l()
  72. end
  73.  
  74. function flfrp()
  75. f()
  76. l()
  77. fnp()
  78. r()
  79. end
  80.  
  81. function p()
  82. placeDown()
  83. end
  84.  
  85. while true do
  86. up()
  87. for i = 1, 4 do
  88. p()
  89. fnp()
  90. fnp()
  91. fnp()
  92. fnp()
  93. rfl()
  94. fnp()
  95. fnp()
  96. rfl()
  97. fnp()
  98. fnp()
  99. rfl()
  100. fnp()
  101. rfl()
  102. fnp()
  103. rfl()
  104. fnp()
  105. rfl()
  106. fnp()
  107. rfl()
  108. fnp()
  109. r()
  110. fnp()
  111. flfrp()
  112. fnp()
  113. flfrp()
  114. fnp()
  115. fnp()
  116. fnp()
  117. f()
  118. end
  119. end
Add Comment
Please, Sign In to add comment