Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local forbidItems = {
- "lavastone",
- "cobblestone",
- "diorite",
- "dirt",
- "gravel",
- "granite",
- "andesite",
- "scoria",
- "marble"
- }
- function termReset()
- term.clear()
- term.setCursorPos(1,1)
- end
- function refu()
- turtle.select(1)
- if (turtle.getItemCount() < 1) then
- term.clear()
- print("No fuel!")
- return
- end
- if not (turtle.refuel()) then
- term.clear()
- print("Refuel Error!")
- return
- end
- end
- function digRound(right)
- while (turtle.detect()) do
- turtle.dig()
- end
- if (right) then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- end
- function digRoundSolo()
- while (turtle.detect()) do
- turtle.dig()
- end
- end
- local limit
- while not (tonumber(limit)) do
- termReset()
- print("How far would you like the turtle to dig in forward blocks? Must be number.");
- limit = read()
- end
- limit = math.floor(tonumber(limit))
- local temp = 5
- termReset()
- print("Make sure turtle is in the bottom left of 3x3")
- while (temp > 0) do
- sleep(1)
- temp = temp - 1
- end
- termReset()
- print("running 3x3 mine for " .. limit .. " blocks")
- local path = 0
- -- refu()
- while (path < limit) do
- -- if (turtle.getFuelLevel() < 1) then
- -- refu()
- -- end
- turtle.up()
- turtle.up()
- digRound(true)
- digRound(true)
- digRoundSolo()
- turtle.down()
- digRound(false)
- digRound(false)
- digRoundSolo()
- turtle.down()
- digRound(true)
- digRound(true)
- digRoundSolo()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- local slot = 1
- while (slot <= 16) do
- turtle.select(slot)
- local data = turtle.getItemDetail()
- for i, v in pairs(forbidItems) do
- if (data) then
- if string.find(data.name, v) then
- turtle.dropDown(turtle.getItemCount())
- end
- end
- end
- slot = slot + 1
- end
- path = path + 1
- end
- termReset()
- print("Done! Returning Home")
- turtle.turnRight()
- turtle.turnRight()
- while (path > 0) do
- turtle.forward()
- path = path - 1
- end
- termReset()
- print("Done!")
Add Comment
Please, Sign In to add comment