Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drop()
- for i = 1,14 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- turtle.dropDown()
- end
- end
- end
- function chop()
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- end
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- if turtle.detectDown() then
- break
- end
- end
- turtle.back()
- end
- function plant()
- turtle.select(15) -- sapling
- turtle.place()
- sleep(2)
- turtle.select(16) -- bone meal
- turtle.place()
- turtle.select(1)
- end
- function sapling()
- if turtle.getItemCount(15) < 1 then
- turtle.select(15)
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- turtle.select(1)
- end
- end
- function bonemeal()
- if turtle.getItemCount(16) < 1 then
- turtle.select(16)
- turtle.turnLeft()
- turtle.suck()
- turtle.turnRight()
- turtle.select(1)
- end
- end
- function check()
- bonemeal()
- sapling()
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("enter Command!")
- input = read()
- if input == "plant" then
- check()
- plant()
- end
- if input == "chop" then
- chop()
- end
- if input == "auto" then
- while true do
- check()
- plant()
- sleep(2)
- chop()
- drop()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement