VIP_CreaTive100

!_Auto-Download/Update - Raum

Nov 17th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. shell.run("clear") -- Bildschirm leeren
  2. print("Wie breit soll der Raum sein:")
  3. breite = read()
  4. print("Wie tief soll der Raum sein:")
  5. tiefe = read()
  6. print("Wie hoch soll der Raum sein:")
  7. hoehe = read()
  8.  
  9. shell.run("clear") -- Bildschirm leeren
  10.  
  11. -- Variablen
  12. breite2 = breite / 2
  13. blockstotal = breite * tiefe * hoehe
  14. blockstobreak = blockstotal
  15.  
  16. function forward()
  17. while(turtle.forward()==false) do
  18. turtle.dig()
  19. end
  20. blockstobreak = blockstobreak - 1
  21. startscreen()
  22. end
  23.  
  24. function forward_odd()
  25. while(turtle.forward()==false) do
  26. turtle.dig()
  27. end
  28. startscreen()
  29. end
  30.  
  31. function backhome()
  32. while(turtle.forward()==false) do
  33. turtle.dig()
  34. end
  35. startscreen()
  36. end
  37.  
  38. function up()
  39. while(turtle.up()==false) do
  40. turtle.digUp()
  41. end
  42. end
  43.  
  44. function linie()
  45. for x=1,tiefe - 1 do
  46. forward()
  47. end
  48. end
  49.  
  50. function linie_odd()
  51. for x=1,tiefe - 1 do
  52. forward_odd()
  53. end
  54. end
  55.  
  56. function turnright()
  57. turtle.turnRight()
  58. forward()
  59. turtle.turnRight()
  60. end
  61.  
  62. function turnleft()
  63. turtle.turnLeft()
  64. forward()
  65. turtle.turnLeft()
  66. end
  67.  
  68. function turn()
  69. turtle.turnRight()
  70. turtle.turnRight()
  71. end
  72.  
  73. --Anzeige Start
  74. function time()
  75. term.setCursorPos(23, 2) -- position auf Zeit setzten
  76. local day -- locale Variable fuer den Tag in Minecraft
  77. local zeit -- locale Variable fuer die Uhrzeit in Minecraft
  78. day = os.day() -- nicht im Gebrauch!
  79. zeit = textutils.formatTime(os.time(), true) -- wandelt die anzeige in das 24 Stunden Format
  80. if (string.len(zeit) == 4) then -- zeit Anzeigt vor oder nach 10 Uhr
  81. print("Zeit: " .. zeit) -- vor 10 Uhr, es geht um die laenge
  82. else
  83. print("Zeit: " .. zeit) -- nach 10 Uhr
  84. end
  85. end
  86.  
  87. function startscreen()
  88. term.clear()
  89. term.setCursorPos( 1, 1)
  90. term.clearLine(1,1)
  91. fuellevel = turtle.getFuelLevel()
  92. print("Raum by")
  93. term.setCursorPos( 23, 1)
  94. print("Fuel-Level: " .. fuellevel)
  95. term.setCursorPos( 1, 2)
  96. print("xXExpchampXx")
  97. term.setCursorPos( 1, 3)
  98. print("=======================================")
  99. term.setCursorPos( 1, 5)
  100. print("---------------------------------------")
  101. term.setCursorPos( 1, 6)
  102. print("Row "..countbreite .. " from "..breite.."finished")
  103. term.setCursorPos( 1, 7)
  104. print("Height "..akt_hoehe .. " from "..hoehe.." finished")
  105. term.setCursorPos( 1, 9)
  106. print("Blocks to break(Total): " .. blockstotal)
  107. term.setCursorPos( 1, 10)
  108. print("Blocks Remaining: " .. (blockstobreak - hoehe))
  109. term.setCursorPos( 1,11)
  110. print("---------------------------------------")
  111. term.setCursorPos( 1,12)
  112. time()
  113. end
  114. --Anzeige Ende
  115.  
  116. for x=1,1 do
  117. local breite3 = breite + 0
  118. local breite4 = breite3 - 1
  119.  
  120. local hoehe2 = hoehe + 0
  121. akt_hoehe = 0
  122.  
  123. for x=1,hoehe do
  124. countbreite = 0
  125. for x=1,breite2 do
  126. linie()
  127. turnright()
  128. linie()
  129. countbreite = countbreite + 2
  130. if countbreite < breite3 then
  131. turnleft()
  132. end
  133. -- Startet eine letzte Linie, wenn ungrade Breite
  134. if countbreite == breite4 then
  135. linie()
  136. countbreite = countbreite + 1
  137. turn()
  138. linie_odd()
  139. end
  140. end
  141. turtle.turnRight()
  142. for x=1,breite - 1 do
  143. backhome()
  144. end
  145. akt_hoehe = akt_hoehe + 1
  146. if akt_hoehe < hoehe2 then
  147. turtle.turnRight()
  148. up()
  149. else
  150. turtle.turnRight()
  151. for x=1,hoehe - 1 do
  152. turtle.down()
  153. end
  154. end
  155. end
  156. while true do -- Endlosschleife nach Beendigung des Programms
  157. startscreen()
  158. term.setCursorPos( 1, 4)
  159. print("--Raum beendet--")
  160. sleep(1)
  161. end
  162. end
Add Comment
Please, Sign In to add comment