Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ( HOLZ) --
- aufsammeln = 20
- fuellevel = 100
- count = 0
- treeblock = "minecraft:log"
- chestdistance = 5
- j = 0
- function fell()
- count = count + 1
- print("Baum Nr. " ..count.. " wird gefaellt!")
- while(turtle.forward()==false) do
- turtle.dig()
- end
- success, data = turtle.inspectUp()
- while(success and data.name==treeblock) do
- turtle.digUp()
- turtle.up()
- success, data = turtle.inspectUp()
- end
- while(turtle.down()) do end
- while(turtle.back()==false) do end
- end
- function place()
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- end
- function collect()
- print("Sammle auf")
- sleep(aufsammeln)
- turtle.suck()
- while(turtle.down()==false) do end
- turtle.suckDown()
- sleep(1)
- turtle.suckDown()
- sleep(1)
- turtle.suckDown()
- sleep(1)
- while(turtle.up()==false) do end
- end
- function refuel()
- if(turtle.getFuelLevel() < fuellevel) then
- turtle.select(16)
- turtle.refuel(1)
- print("Aufgetankt")
- end
- end
- function forward()
- while(turtle.forward()==false) do end
- end
- function goback()
- turtle.turnRight(2)
- forward(4)
- turtle.up(5)
- end
- -- (Programm Start Holz) --
- for j=1,2 do
- turtle.select(1)
- success, data = turtle.inspect()
- if(success and data.name==treeblock) then
- refuel()
- fell()
- place()
- sleep(5)
- collect()
- refuel()
- else
- print("Kein Baum")
- Sleep(10)
- j = j+1
- end
- end
- goback()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement