Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slots ={}
- function plantTree()
- turtle.select(1)
- turtle.place()
- end
- function chopTree()
- turtle.select(4)
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- end
- function hasTreeGrown()
- turtle.select(3)
- return turtle.compare()
- end
- function bonemealTree()
- turtle.select(2)
- turtle.place()
- end
- function dropOffResources()
- for i=4, 16, 1 do
- turtle.select( i )
- turtle.dropDown( 64 )
- end
- end
- function checkSlot( slot )
- if turtle.getItemCount(2) == 0 then
- if slots[ slot ] == true then
- print( "Slot " + slot + " empty" )
- slots[ slot ] = false
- end
- else
- slots[ slot ] = true
- end
- end
- while true do
- if hasTreeGrown() then
- chopTree()
- dropOffResources()
- else
- plantTree()
- bonemealTree()
- end
- sleep(1)
- checkSlot( 1 )
- checkSlot( 2 )
- checkSlot( 3 )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement