Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --vars
- local count = 0
- local dist = 0
- --functions
- function cuttree()
- count = 0
- turtle.select(3)
- turtle.dig()
- if turtle.forward() == false then
- turtle.select(1)
- return
- end
- while turtle.digUp() == true do
- turtle.up()
- count = count + 1
- end
- for i=1,count,1 do
- turtle.down()
- end
- turtle.back()
- turtle.select(1)
- turtle.place()
- while turtle.getItemCount(1) < 5 do
- print("Low on saplings! Place a stack of saplings in slot 1!")
- sleep(5)
- end
- end
- function Checkloop()
- while true do
- --dist = 0
- while true do
- turtle.turnLeft()
- suck()
- turtle.select(2)
- if turtle.compare() == true then
- cuttree()
- end
- turtle.turnRight()
- turtle.select(2)
- if turtle.forward() == false then
- break
- end
- --dist = dist+1
- end
- turtle.turnRight()
- turtle.turnRight()
- --for i=1,dist,1 do
- while turtle.forward() == true do
- suck()
- end
- turtle.turnLeft()
- for i = 3,16,1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnLeft()
- suck()
- turtle.select(2)
- sleep(300)
- end
- end
- function suckIfNotFull(slot)
- turtle.select(slot)
- if turtle.getItemSpace(slot) > 0 then
- turtle.suckDown()
- end
- end
- function suck()
- turtle.select(1)
- while turtle.suck()==true do end
- while turtle.suckDown()==true do end
- end
- function initCheckSlots()
- while turtle.getItemCount(1) == 0 or turtle.getItemSpace(1) > 32 do
- print("Please put a half+ stack of saplings in slot 1!")
- sleep(2)
- end
- while turtle.getItemCount(2) == 0 do
- print("Please put a single block of wood in slot 2!")
- sleep(2)
- end
- print("Make sure there is a chest to the right of me currently...")
- sleep(3)
- print("Starting logger...")
- end
- initCheckSlots()
- Checkloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement