Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checking(list,func)
- if type(func) ~= "function" then
- write("need select function")
- shell.exit()
- end
- local suc,ans = func()
- if suc == false then return false end
- for i, v in ipairs(list) do
- if v.name == ans.name then
- if v.metadata == nil then
- return true
- else
- if v.metadata == ans.metadata then
- return true
- end
- end
- end
- end
- end
- function selectFromID(idname)
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- if turtle.getItemDetail(i)["name"] == idname then
- turtle.select(i)
- return true
- end
- end
- end
- return false
- end
- function isEmpty()
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- return false
- end
- end
- return true
- end
- local NGS = { {name = "minecraft:bedrock"}
- , {name = "minecraft:flowing_lava",metadata = 0}
- , {name = "factorization:BlastedBedrock"}}
- while true do
- local dlong = 0
- while true do
- turtle.select(1)
- if checking(NGS,turtle.inspectDown) then
- break
- end
- turtle.digDown()
- turtle.down()
- dlong = dlong + 1
- if checking(NGS,turtle.inspect) then
- break
- end
- turtle.dig()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1, dlong do
- turtle.dig()
- turtle.up()
- end
- if selectFromID("minecraft:cobblestone") then
- turtle.down()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.up()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- write("\nnow fuel is "..turtle.getFuelLevel()..".\nplz take all items.")
- while not isEmpty() do
- os.pullEvent("turtle_inventory")
- end
- write("\ncheck it.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement