Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Lumberjack turtle program
- --turtles cnnot go forward onto saplings as it considers the sapling an obstruction.
- local chest = peripheral.find("minecraft:chest")
- local chestName = "minecraft:chest_3500"
- local chestdir = "south"
- local modem = peripheral.find("modem")
- local turtleNetName = modem.getNameLocal()
- chest.pullItems(turtleNetName,2,64)
- local moveCount=0
- --local chest = "minecraft:chest_14"
- local success
- local data
- success, data = turtle.inspect()
- if data.name =="minecraft:log" then
- turtle.dig()
- turtle.digUp()
- turtle.up()
- moveCount = moveCount + 1
- else
- repeat until not turtle.down()
- end
- if data.name ~= "minecraft:sapling" then
- turtle.select(1)
- turtle.place()
- end
- --repeat until not turtle.down()
- while true do
- turtle.select(3)
- if turtle.getFuelLevel() == 0 then turtle.refuel(1) end
- turtle.select(2)
- repeat
- success, data = turtle.inspect()
- until data.name == "minecraft:log"
- -- if success then
- -- print("Block name: ", data.name)
- -- print("Block metadata: ", data.metadata)
- -- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.up()
- success2 , blockcheck = turtle.inspectUp()
- if blockcheck.name == "minecraft:log" then
- repeat
- turtle.digUp()
- turtle.up()
- success2 , blockcheck = turtle.inspectUp()
- until blockcheck.name ~= "minecraft:log"
- end
- -- else
- -- repeat
- -- --sleep(1)
- -- repeat
- -- turtle.suck()
- -- success, data = turtle.inspect()
- -- until data.name == "minecraft:log"
- -- turtle.dig()
- -- turtle.digUp()
- -- turtle.up()
- -- moveCount = moveCount + 1
- -- until data.name ~= "minecraft:log"
- -- for move = 1 , moveCount do
- -- turtle.down()
- -- end
- repeat until not turtle.down()
- turtle.back()
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- chest.pullItems(turtleNetName,2,64)
- -- peripheral.call("minecraft:hopper_1","pushItems","turtle_0",1)
- -- chest = peripheral.wrap("minecraft:chest_14")
- -- chest.pullItems("turtle_0",2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement