Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Mining turtle carries around a furnace and makes its own charcoal
- logs = turtle.getItemCount(1) --Place logs in first slot
- planks = turtle.getItemCount(2) --Place planks/fuel in second slot
- function insertWood() --Turtle at top of furnace, puts wood and fuel in and moves down
- turtle.select(1)
- turtle.dropDown()
- for i=1,2 do
- turtle.turnRight()
- end
- turtle.forward()
- for i=1,2 do
- turtle.down()
- turtle.turnLeft()
- end
- turtle.forward()
- turtle.select(2)
- turtle.dropUp()
- end
- function returnHome() --Turtle returns to top of furnace
- turtle.forward()
- for i=1,2 do
- turtle.up()
- turtle.turnLeft()
- end
- turtle.forward()
- for i=1,2 do
- turtle.turnLeft()
- end
- end
- function placeFurnace() --Places furnace from slot 4, make sure it has 2
- turtle.up()
- if turtle.detect() then
- turtle.back()
- turtle.back()
- end
- turtle.select(4)
- turtle.place()
- turtle.up()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function mineFurnace() --Mines the furnace from the top
- turtle.select(4)
- if turtle.compareDown() then
- turtle.digDown()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- --Main code
- placeFurnace()
- print(logs.." logs. "..planks.." planks.")
- insertWood()
- sleep(logs * 10 + 15) --Sleeps long enough for the wood to become charcoal
- turtle.suckUp()
- turtle.transferTo(16)
- returnHome()
- mineFurnace()
Advertisement
Add Comment
Please, Sign In to add comment