Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function digForward(weite)
- for aktuelleweite = 0, weite, 1 do
- turtle.dig()
- turtle.forward()
- if turtle.detectDown() == false then
- turtle.select(1)
- turtle.placeDown()
- end
- end
- end
- function nextLineLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- if turtle.detectDown() == false then
- turtle.select(1)
- turtle.placeDown()
- end
- turtle.turnLeft()
- end
- function nextLineRight()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- if turtle.detectDown() == false then
- turtle.select(1)
- turtle.placeDown()
- end
- turtle.turnRight()
- end
- function getSize()
- shell.run("clear")
- print("--- MineTurtle ~ Raumgraeber ---")
- write("Bitte gebe die Breite ein:")
- breite = io.read()
- write("Bitte gebe die Tiefe ein:")
- tiefe = io.read()
- write("Bitte gebe die Hoehe ein:")
- hoehe = io.read()
- end
- function startMine()
- for i = 0, breite-1, 1 do
- digForward(tiefe-1)
- if i == 0 then
- nextLineLeft()
- end
- if i == 1 then
- nextLineRight()
- end
- if i >= 2 then
- if i % 2 == 0 then
- nextLineLeft()
- end
- if i % 2 > 0 then
- nextLineRight()
- end
- end
- end
- end
- function main()
- option = "n"
- getSize()
- print("Soll ein bereich von:")
- print("X: "..breite.." Z:"..tiefe.." Y:"..hoehe)
- write("ausgehoben werden? y/n> ")
- option = io.read()
- if option == "y" then
- startMine()
- end
- end
- breite = 0
- tiefe = 0
- hoehe = 0
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement