Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function unload()
- turtle.back()
- for i = 3, 16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.forward()
- end
- function checkFull()
- if turtle.getItemCount(16) > 0 then
- unload()
- end
- end
- function move()
- turtle.dig()
- turtle.forward()
- end
- function chopUp()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- end
- function backDown()
- while not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- end
- function placeSapling()
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- end
- function reUp()
- if turtle.getItemCount(1) == 0 then
- turtle.select(1)
- turtle.suckDown()
- elseif turtle.getItemDetail(1).name ~= "minecraft:dye" then
- turtle.select(1)
- turtle.drop()
- turtle.suckDown()
- end
- end
- function treeGrew()
- local success, data = turtle.inspect()
- if success then
- if data.name == "ic2:rubber_wood" or data.name == "minecraft:log"then
- return true;
- else
- return false;
- end
- end
- end
- function growTree()
- repeat
- reUp()
- turtle.place()
- until treeGrew()
- end
- while true do
- growTree()
- move()
- chopUp()
- backDown()
- checkFull()
- placeSapling()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement