Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function getblock(namea,numa)
- turtle.select(16)
- turtle.place()
- local allyfind = true
- while allyfind do
- local EnderStacks = peripheral.call("front","getAllStacks")
- local EnderSize = peripheral.call("front","getInventorySize")
- local EnderChest = peripheral.wrap("front")
- for i=1, EnderSize do
- if EnderStacks[i] ~= nil then
- if string.find(string.lower(EnderStacks[i]["name"]), namea) and allyfind then
- allyfind = false
- EnderChest.pushItemIntoSlot("east",i,numa)
- end
- end
- end
- sleep(1)
- print(allyfind)
- print(namea)
- end
- turtle.select(16)
- turtle.dig()
- turtle.select(1)
- end
- local function fuelCheck()
- print(turtle.getFuelLevel())
- if turtle.getFuelLevel() < 100 then
- getblock("coal",30)
- turtle.refuel(64)
- print(turtle.getFuelLevel())
- end
- end
- local function clearinv()
- if turtle.getItemCount(1) > 0 then
- turtle.select(16)
- turtle.place()
- for i=1, 12 do
- turtle.select(i)
- turtle.drop(64)
- end
- end
- turtle.select(16)
- turtle.dig()
- end
- while true do
- fuelCheck()
- clearinv()
- turtle.digDown()
- turtle.forward()
- sleep(120)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement