Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Up()
- repeat until turtle.up()
- end
- function Down()
- repeat until turtle.down()
- end
- function Forward()
- repeat until turtle.forward()
- end
- function Back()
- repeat until turtle.back()
- end
- function TR()
- turtle.turnRight()
- end
- function TL()
- turtle.turnLeft()
- end
- function Search(item)
- for i=1,16 do
- local data = turtle.getItemDetail(i)
- if data ~= nil and data.name == item then
- return i
- end
- end
- return false
- end
- function Deposit()
- TL()
- TL()
- for i=1,16 do
- local data = turtle.getItemDetail(i)
- if data ~= nil and data.name == "minecraft:log" then
- turtle.select(i)
- turtle.drop()
- end
- end
- TL()
- TL()
- end
- function GetTrees()
- TL()
- repeat
- turtle.suck(64)
- until Search("minecraft:sapling")
- TR()
- end
- function GetFert()
- TR()
- repeat
- turtle.suck(64)
- until Search("Forestry:fertilizerCompound")
- TL()
- end
- function MainLoop()
- if not Search("minecraft:log") then
- GetTrees()
- end
- turtle.select(Search("minecraft:sapling"))
- turtle.place()
- repeat
- if not Search("Forestry:fertilizerCompound") then
- GetFert()
- end
- turtle.select(Search("Forestry:fertilizerCompound"))
- turtle.place()
- suc, data = turtle.inspect()
- until data.name == "minecraft:log"
- turtle.dig()
- Forward()
- local count = 0
- while turtle.detectUp() do
- turtle.digUp()
- Up()
- count = count + 1
- end
- for i=1, count do
- Down()
- end
- Back()
- if turtle.getItemCount(16) ~= 0 then
- Deposit()
- end
- end
- while true do
- MainLoop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement