Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------- Untere Linke Ecke des Raumes ist der Start --------
- -------- Wie soll der Raum aussehen --------
- digX=10 --Nach vorne
- digY=10 --Nach Rechts
- ReplaceUp=0
- ReplaceDown=0
- RefuelOnStartUp=1
- print("Version 0.5 (15.09.2019)")
- -------- Ab hier Finger weg --------
- -------- PROGRAMM START --------
- function checkReplace(posX,posY,posZ)
- if posX == digX then
- if ReplaceFront==1 then
- API.replace()
- end
- end
- if posX == 0 then
- if ReplaceBack==1 then
- API.replaceBack()
- end
- end
- if posY == 0 then
- if ReplaceLeft==1 then
- API.replaceLeft()
- end
- end
- if posY == digY-1 then
- if ReplaceRight==1 then
- API.replaceRight()
- end
- end
- if posZ == 0 then
- if ReplaceDown==1 then
- API.replaceDown()
- end
- end
- if posZ == digZ-1 then
- if ReplaceUp==1 then
- API.replaceUp()
- end
- end
- end
- -------- PROGRAMM START --------
- os.loadAPI("API")
- API.Version()
- ReplaceLeft=0
- ReplaceRight=0
- ReplaceFront=0
- ReplaceBack=0
- digZ = 1
- print("Raum der Laenge")
- print(digX)
- print("Raum der Breite")
- print(digY)
- print("Raum der Hoehe")
- print(digZ)
- print("Replace:")
- if ReplaceFront==1 then
- print("Vorn")
- end
- if ReplaceBack==1 then
- print("Hinten")
- end
- if ReplaceLeft==1 then
- print("Links")
- end
- if ReplaceRight==1 then
- print("Rechts")
- end
- if ReplaceDown==1 then
- print("Unten")
- end
- if ReplaceUp==1 then
- print("Oben")
- end
- if ReplaceUp ==0 then
- if ReplaceDown == 0 then
- print("Es wird nichts gesetzt")
- end
- end
- read()
- if RefuelOnStartUp==1 then
- for N = 1, 16, 1 do
- turtle.select(N)
- turtle.refuel()
- end
- gesammt = 2*digX*digY*digZ
- fuel = turtle.getFuelLevel()
- if gesammt>fuel then
- print("Nicht genug Fuel")
- API.fuel(gesammt)
- end
- end
- digX=digX/2
- digY=digY/2
- digX=digX-1
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- checkReplace(0,0,0)
- for variableY = 1, digY, 1 do
- yleft=digY-variableY+1
- write("Noch ")
- write(yleft-1)
- print(" Felder nach Rechts")
- for variableZ = 1, digZ, 1 do
- for variableX = 1, digX, 1 do
- API.forward(2)
- checkReplace(variableX,variableY-1,variableZ-1)
- end
- API.homeX()
- if variableZ<digZ then
- API.up()
- checkReplace(0,variableY-1,variableZ)
- end
- end
- API.homeZ()
- if variableY<digY then
- API.right(2)
- checkReplace(0,variableY,0)
- end
- end
- API.homeY()
- turtle.back()
- turtle.turnRight()
- turtle.back()
- turtle.turnLeft()
- print("Fertig")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement