Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=0
- refuelNeeded=true
- local function start()
- turtle.select(1)
- if turtle.compareTo(16)==false then
- print("Bitte sicherstellen, dass Saplings in Slot 1 und Vergleichssapling in Slot 16 liegen und [Enter] druecken.")
- io.read()
- return
- end
- end
- local function refuel()
- if (turtle.getFuelLevel()<100 and refuelNeeded==true) then
- turtle.select(2)
- turtle.refuel(turtle.getItemCount(2))
- turtle.select(1)
- end
- end
- local function plant()
- if (turtle.getFuelLevel()<30 and refuelNeeded==true) then
- print("Kein Treibstoff mehr vorhanden. Bitte Treibstoff in Slot 2 geben und eine Taste druecken.")
- end
- turtle.select(1)
- if turtle.getItemCount(1)<=1 then
- print("Bitte Saplings in Slot 1 nachfuellen.")
- io.read()
- return
- end
- turtle.forward()
- turtle.place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.place()
- end
- local function wait()
- turtle.select(1)
- turtle.up()
- while turtle.detect()==false do
- sleep(1)
- end
- end
- local function tree()
- turtle.select(2)
- turtle.down()
- turtle.dig()
- turtle.forward()
- local h=0
- while turtle.detectUp()==true do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- h=h+1
- end
- refuel()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- for i=h, 1, -1 do
- turtle.dig()
- turtle.digDown()
- turtle.down()
- end
- turtle.dig()
- h=nil
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- x=x+1
- term.clear()
- term.setCursorPos(1, 1)
- print("Es wurden bisher ", x, " Baeume gefaellt.")
- end
- local function drop()
- refuel()
- turtle.turnLeft()
- turtle.select(2)
- if turtle.getItemCount(2)>1 then
- turtle.drop()
- end
- for i=3, 15, 1 do
- turtle.select(i)
- if turtle.getItemCount(i)>0 then
- turtle.drop()
- end
- end
- turtle.turnRight()
- end
- --------------------------
- start()
- while true do
- plant()
- drop()
- wait()
- tree()
- end
Advertisement
Add Comment
Please, Sign In to add comment