Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function destroy()
- turtle.digDown()
- turtle.dig()
- turtle.digUp()
- end
- function advance()
- turtle.dig()
- turtle.forward()
- destroy()
- turtle.forward()
- destroy()
- turtle.forward()
- destroy()
- turtle.back()
- end
- function anyFullSlot()
- for slotNum = 3, 16, 1 do
- turtle.select(slotNum)
- if (turtle.getItemSpace() == 0) then
- return true
- end
- end
- return false
- end
- function depositItems()
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for slotNum = 3, 16, 1 do
- turtle.select(slotNum)
- turtle.dropDown(turtle.getItemCount()-1)
- end
- end
- function hasChests()
- return (turtle.getItemCount(1) > 0)
- end
- print("+-------------------------------------+")
- print("| Chest Miner |")
- print("| Slot 1: Chests |")
- print("| Slot 2: Fuel |")
- print("| Slot 3: Valuables |")
- print("+-------------------------------------+")
- print("| Dig Height = ? |")
- print("+-------------------------------------+")
- h = tonumber(read())
- while (hasChests()) do
- advance()
- for i = 0, h-3, 1 do
- turtle.up()
- destroy()
- end
- advance()
- for i = 0, h-3, 1 do
- turtle.down()
- destroy()
- end
- if (turtle.getFuelLevel() < 80) then
- turtle.select(2)
- turtle.refuel(1)
- end
- if (anyFullSlot()) then
- depositItems()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement