Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local d
- local l
- local b
- local h
- print("Dieses Programm baut einen Boden")
- print("Mit Freiraum drüber")
- print("Wollen Sie den Raum links(1) oder rechts(2) haben?")
- d = tonumber(io.read())
- print("Geben Sie die Groesse des Raumes an")
- print("Länge:")
- l = tonumber(io.read())
- print(" ")
- print("Breite:")
- b = tonumber(io.read())
- print(" ")
- print("Höhe:")
- h = tonumber(io.read())
- local i = 1
- local n = 1
- local a = 1
- local z = 0
- local x
- while i<b do
- while n<l do
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- while a<h do
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- if turtle.up() == true then
- a=a+1
- end
- end
- a=1
- while a<h do
- if turtle.detectDown()==true then
- turtle.digDown()
- end
- if turtle.down() == true then
- a=a+1
- end
- end
- a=1
- if turtle.detectDown()==true then
- turtle.digDown()
- end
- turtle.select(1)
- turtle.placeDown()
- z = z+1
- if z==64 then
- print("Bitte Slot 1 neu füllen")
- print("Schreiben Sie die 1, wenn Slot 1 voll ist")
- x = tonumber(io.read())
- turtle.select(1)
- while turtle.getItemCount() < 64 do
- print("Bitte Slot 1 neu füllen")
- print("Schreiben Sie die 1, wenn Slot 1 voll ist")
- x = tonumber(io.read())
- end
- z=0
- end
- while turtle.detect()==true do
- turtle.dig()
- end
- if turtle.forward() == true then
- n=n+1
- end
- end
- n=1
- if b%2 == 1 then
- if d == 2 then
- turtle.turnRight()
- while turtle.detect()==true do
- print("dig1")
- turtle.dig()
- end
- if turtle.forward() == true then
- turtle.turnRight()
- b=b+1
- write("b1 = ")
- write(b)
- end
- end
- if d == 1 then
- turtle.turnLeft()
- while turtle.detect()==true do
- turtle.dig()
- end
- if turtle.forward() == true then
- turtle.turnLeft()
- b=b+1
- end
- end
- end
- elseif b%2 == 0 then
- if d == 1 then
- turtle.turnRight()
- while turtle.detect()==true do
- turtle.dig()
- end
- if turtle.forward() == true then
- turtle.turnRight()
- b=b+1
- end
- end
- if d == 2 then
- turtle.turnLeft()
- print("left")
- while turtle.detect()==true do
- print("dig")
- turtle.dig()
- end
- print("for")
- if turtle.forward() == true then
- print("2left")
- turtle.turnLeft()
- b=b+1
- write("b = ")
- write(b)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement