Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. print("Slot16: Fackeln")
  2. print("Slot15: Endertruhe")
  3. print("Slot14: Muell")
  4. print("Wie lang soll der Gang werden?:")
  5. lang=io.read()
  6. lang=lang+0
  7. lang1=lang
  8.  
  9. print("Wie breit soll der Gang werden?:")
  10. breit=io.read()
  11. breit=breit+0
  12. breit1=breit
  13.  
  14. fackel=0
  15. fackel1=-1
  16.  
  17.  
  18. function VOR()
  19. while turtle.detect()==true do
  20. turtle.dig()
  21. os.sleep(0.5)
  22. end
  23.  
  24. turtle.forward()
  25.  
  26. while turtle.detectUp()==true do
  27. turtle.digUp()
  28. os.sleep(0.5)
  29. end
  30.  
  31. while turtle.detectDown()==true do
  32. turtle.digDown()
  33. end
  34. end
  35.  
  36.  
  37. function CLEAN()
  38. for i=13,1,-1 do
  39. turtle.select(i)
  40. if turtle.compareTo(14) then
  41. turtle.drop()
  42. end
  43. end
  44.  
  45. turtle.down()
  46. turtle.turnLeft()
  47. turtle.turnLeft()
  48. turtle.select(15)
  49. turtle.place()
  50.  
  51. for k=1,13 do
  52. turtle.select(k)
  53. turtle.drop()
  54. end
  55.  
  56. turtle.select(15)
  57. turtle.dig()
  58. turtle.turnLeft()
  59. turtle.turnLeft()
  60. turtle.up()
  61. end
  62.  
  63.  
  64. function LIGHT()
  65. turtle.back()
  66. turtle.down()
  67. turtle.turnLeft()
  68. turtle.turnLeft()
  69. turtle.select(16)
  70. turtle.place()
  71. turtle.turnRight()
  72. turtle.turnRight()
  73. turtle.up()
  74. turtle.forward()
  75. end
  76.  
  77. turtle.up()
  78.  
  79. while breit>0 do
  80.  
  81. while lang>0 do
  82. VOR()
  83. lang=lang-1
  84. fackel=fackel+1
  85.  
  86. if fackel==4 and fackel1<=0 then
  87. LIGHT()
  88. fackel1=0
  89. end
  90.  
  91. if fackel==4 and fackel1==2 then
  92. LIGHT()
  93. fackel1=0
  94. end
  95.  
  96. if fackel==4 then
  97. fackel=0
  98. end
  99. end
  100.  
  101. lang=lang+lang1
  102. fackel1=fackel1+1
  103. breit=breit-1
  104.  
  105.  
  106. if breit<=0 then
  107. turtle.turnLeft()
  108. turtle.turnLeft()
  109.  
  110. while lang>0 do
  111. turtle.forward()
  112. lang=lang-1
  113. end
  114.  
  115. CLEAN()
  116. turtle.down()
  117. fackel=0
  118. turtle.turnLeft()
  119.  
  120. while breit1>0 do
  121. turtle.forward()
  122. breit1=breit1-1
  123. end
  124. turtle.turnLeft()
  125. breit=breit-1
  126. end
  127.  
  128.  
  129.  
  130. if breit>=1 then
  131. turtle.turnLeft()
  132. VOR()
  133. turtle.turnLeft()
  134.  
  135. while lang>0 do
  136. VOR()
  137. lang=lang-1
  138. end
  139.  
  140. CLEAN()
  141. turtle.turnRight()
  142. VOR()
  143. turtle.turnRight()
  144. fackel=0
  145. breit=breit-1
  146. end
  147.  
  148. lang=lang+lang1
  149. end
  150.  
  151. term.clear()
  152. term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement