Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = require( "blib" )
- local sapling = "minecraft:oak_sapling"
- local bonemeal = "minecraft:bone_meal"
- local log = "minecraft:oak_log"
- function Main()
- while( m.GetItemIndex(sapling) ) do
- if( not m.CheckFuel(30) ) then
- print( "Out of fuel" )
- return
- end
- local boneSlot = m.GetItemIndex(bonemeal)
- local sapSlot = m.GetItemIndex( sapling )
- -- BONE CHECK / 'refuel bones'
- -- SAP CHECK / 'refuel saps'
- -- CHECK FULL?
- if(boneSlot ~= nil) then
- turtle.select(boneSlot)
- while( turtle.place() )do
- if( turtle.getItemCount() == 0 ) then
- boneSlot = m.GetItemIndex(bonemeal)
- if( boneSlot == nil ) then
- print( "Out of bonemeal" ) -- Try getting more bonemeal from a chest or sum
- return
- end
- end
- end
- redstone.setOutput("back", true)
- os.sleep(1)
- redstone.setOutput("back", false)
- turtle.dig()
- turtle.forward()
- local success, data = turtle.inspectUp()
- while( data.name == log ) do
- turtle.digUp()
- turtle.up()
- success, data = turtle.inspectUp()
- end
- success, data = turtle.inspectDown()
- while(data.name ~= "minecraft:dirt") do
- turtle.down()
- success, data = turtle.inspectDown()
- end
- turtle.back()
- if( sapSlot ~= nil ) then
- turtle.select( sapSlot )
- turtle.place()
- end
- end
- end
- end
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement