Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ### FUNKTION LICHT ###
- function licht()
- turtle.back()
- turtle.select(16)
- turtle.placeUp()
- turtle.forward()
- end
- -- ### FUNKTION GRAB ###
- function grab()
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- lr()
- while turtle.detectUp() do
- turtle.digUp()
- end
- turtle.up()
- o()
- lr()
- end
- -- ### FUNKTION BOHR ###
- function bohr()
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- lr()
- while turtle.detectUp() do
- turtle.digUp()
- os.sleep(0.5)
- end
- turtle.up()
- o()
- lr()
- turtle.down()
- end
- -- ### TUNNEL-BREITE ###
- function breit()
- turtle.turnLeft()
- bohr()
- bohr()
- bohr()
- turtle.back()
- turtle.select(16)
- turtle.placeUp()
- turtle.forward()
- turtle.turnRight()
- end
- -- ### FUNCTION DIG ###
- function dig()
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- end
- -- ### FUNCTION GLAS LINKS & RECHTS ###
- function lr()
- turtle.turnLeft()
- if not turtle.detect() then
- turtle.select(14)
- turtle.place()
- end
- turtle.turnRight()
- turtle.turnRight()
- if not turtle.detect() then
- turtle.select(14)
- turtle.place()
- end
- turtle.turnLeft()
- end
- -- ### FUNCTION GLAS OBEN ###
- function o()
- if not turtle.detectUp() then
- turtle.select(15)
- turtle.placeUp()
- end
- end
- -- ### FUNCTION GLAS VORNE ###
- function v()
- if not turtle.detect() then
- turtle.select(15)
- turtle.place()
- end
- end
- -- ### FUNCTION GLAS UNTEN ###
- function u()
- if not turtle.detectDown() then
- turtle.select(13)
- turtle.placeDown()
- end
- end
- -- ################
- -- ### PROGRAMM ###
- -- ################
- local x = 0
- local l = 0
- local a = 0
- local j = 0
- local k = 0
- term.write("NICHT VERGESSEN: Fackeln in Slot 16 !")
- x = read()
- term.write("NICHT VERGESSEN: Glas in Slot 13,14,15 !")
- x = read()
- term.write("Wie lange soll der Gang werden ?")
- l = read()
- term.write("Wieviele Gaenge soll ich graben ?")
- a = read()
- -- function absolut()
- -- ### EINGANG GRABEN ###
- turtle.up()
- dig()
- turtle.forward()
- v()
- o()
- lr()
- dig()
- turtle.forward()
- v()
- o()
- lr()
- turtle.digDown()
- turtle.down()
- lr()
- v()
- u()
- -- ### GANG GRABEN ###
- for i = 1, l do
- k = i - 1
- j = k % 4
- if j == 1 then
- licht()
- end
- grab()
- end
- turtle.select(16)
- turtle.placeUp()
- -- ########## ZURÜCK ZUM START
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1, l do
- turtle.forward()
- end
- turtle.dig()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(1)
- turtle.place()
- -- ########## AUSGANGSPOSITION
- breit()
- -- end
- -- for i = 1, a do
- -- absolut()
- -- end
Advertisement
Add Comment
Please, Sign In to add comment