Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get 180C8NRw RefuelDigger
- local function isTurtleBlock(data)
- return data and type(data.name) == "string" and data.name:match("computercraft:turtle")
- end
- local function dropOffInventory(itemName)
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- if itemName then
- local data = turtle.getItemDetail(i)
- if data.name == itemName then
- turtle.select(i)
- turtle.drop()
- end
- else
- turtle.select(i)
- turtle.drop()
- end
- end
- end
- end
- local cnt = 0
- while cnt < 4 do
- local success, data = turtle.inspect()
- if success and data.name == "minecraft:chest" then
- turtle.turnLeft()
- turtle.turnLeft()
- break
- end
- turtle.turnLeft()
- cnt = cnt + 1
- end
- while true do
- local success, data = turtle.inspect()
- if success and isTurtleBlock(data) then
- sleep(0.5)
- turtle.dig()
- turtle.turnLeft()
- turtle.turnLeft()
- dropOffInventory()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment