Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local delay = 1
- local wood = {["name"]="minecraft:log",["metadata"]=2}
- local botWood = {["name"]="Botania:livingwood",["metadata"]=0}
- local stone = {["name"]="minecraft:stone",["metadata"]=0}
- local botStone = {["name"]="Botania:livingrock",["metadata"]=0}
- local inItem = {wood,stone}
- local outItem = {botWood,botStone}
- local bBlock = false
- local vBlock = nil
- local inSlot = 1
- local outSlot = 16
- local function checkItem(itemDetail)
- for _,k in pairs(inItem) do
- if itemDetail.damage == k.metadata and itemDetail.name == k.name then
- return true
- end
- end
- return false
- end
- local function checkFront(testBlock)
- for _,k in pairs(outItem) do
- --print(k.metadata," ",testBlock.metadata," ",k.name," ",testBlock.name)
- if testBlock.metadata == k.metadata and testBlock.name == k.name then
- return true
- end
- end
- return false
- end
- while true do
- bBlock,vBlock = turtle.inspect()
- if not bBlock then
- --print(turtle.getItemCount(outSlot)," ",turtle.getItemDetail(outSlot))
- if turtle.getItemCount(outSlot) > 0 and checkItem(turtle.getItemDetail(outSlot)) then
- turtle.select(outSlot)
- turtle.place()
- end
- else
- if checkFront(vBlock) then
- turtle.select(inSlot)
- turtle.dig()
- --if vBlock.name == botStone then
- --turtle.dig()
- --else
- --turtle.dig()
- --end
- end
- end
- sleep(delay)
- end
Add Comment
Please, Sign In to add comment