Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Turtle Miner v.1.3")
- print("")
- print("Die Turtle wird einen 3x3 Gang graben")
- print("Wie lange graben?")
- local length = read()
- local torch = 0
- local left = length
- local willDrop = false
- function checkFuel()
- if turtle.getFuelLevel() < 15 then
- turtle.select(1)
- turtle.refuel()
- end
- end
- function digBlock()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function digBlockUp()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- function status()
- print("[Slot 1] Treibstoff [Slot 2] Fackeln")
- print("")
- print("Reihen uebrig : "..left)
- print("Treibstoff : "..turtle.getFuelLevel())
- end
- function dropRoutine()
- willDrop = true
- for i=3,16 do
- if(turtle.getItemCount(i) == 0) then
- willDrop = false
- end
- end
- if(willDrop == true) then
- term.clear()
- term.setCursorPos(1,1)
- print("")
- print("Inventory full!")
- print("Starting Drop Sub-Routine")
- for i=3,16 do
- data = turtle.getItemDetail(i)
- turtle.select(i)
- if data then
- print("Item name: ", data.name)
- print("Item count: ", data.count)
- if(data.name == "minecraft:cobblestone") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- if(data.name == "minecraft:dirt") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- if(data.name == "minecraft:gravel") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- if(data.name == "chisel:limestone") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- if(data.name == "chisel:marble") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- if(data.name == "minecraft:netherrack") then
- turtle.drop(data.count)
- print("Dropped!")
- end
- else
- print("Empty")
- end
- end
- for loop = 0, 12 do
- term.clear()
- term.setCursorPos(1,1)
- print("Moving Items up...")
- print("")
- print("Sub-Loop ", loop+1, "/ 13")
- for i = 3, 15 do
- turtle.select(i+1)
- data1 = turtle.getItemDetail(i)
- data2 = turtle.getItemDetail(i+1)
- if(not data1 and data2) then
- turtle.transferTo(i)
- end
- end
- end
- end
- turtle.select(3)
- end
- dropRoutine()
- function digLayer()
- for i=1,2 do
- turtle.turnLeft()
- digBlock()
- turtle.turnRight()
- turtle.turnRight()
- digBlock()
- turtle.turnLeft()
- digBlockUp()
- turtle.up()
- end
- turtle.turnLeft()
- digBlock()
- turtle.turnRight()
- turtle.turnRight()
- digBlock()
- if torch == 8 then
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.select(2)
- turtle.placeDown()
- turtle.back()
- turtle.turnLeft()
- turtle.back()
- torch = 0
- end
- turtle.turnLeft()
- turtle.down()
- turtle.down()
- torch = torch + 1
- left = left - 1
- dropRoutine()
- end
- for i=1,length do
- turtle.dig()
- turtle.forward()
- term.clear()
- term.setCursorPos(1,1)
- checkFuel()
- status()
- digLayer()
- end
- term.clear()
- term.setCursorPos(1,1)
- checkFuel()
- status()
- turtle.turnRight()
- turtle.turnRight()
- for i=0,length-3 do
- turtle.forward()
- end
- term.clear()
- term.setCursorPos(1,1)
- checkFuel()
- status()
- print("Fertig!")
Advertisement
Add Comment
Please, Sign In to add comment