Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ********************************************************************************** --
- -- ** OreQuarry REDUX ** --
- -- ** Minecraft Mining Turtle Ore Quarry v0.01 by Soulgriever ** --
- -- ** ** --
- -- ** Written from scratch but heavily inspired by the original OreQuarry ** --
- -- ** by AustinKK ** --
- -- ** ** --
- -- ** For instructions on how to use: ** --
- -- ** ** --
- -- ** http://www.youtube.com/watch?v=PIugLVzUz3g ** --
- -- ** ** --
- -- ** Change Log: ** --
- -- ** 8th Oct 2021: [v0.01] Started writing original rogram ** --
- -- ** TODO: ** --
- -- ** Build Z logic and test initial logic ** --
- -- ** Check Fuel level ** --
- -- ** Ender Chest Support ** --
- -- ** GPS support ** --
- -- ** Charge Station support ** --
- -- ** Initial program start and arguements ** --
- -- ********************************************************************************** --
- --The secret sauce, Main function that digs out defined X and Y while inspecting above and below as it travels
- function digLevel()
- if X > 0 then
- --Inspects if their is a block in front of the turtle and determins if its Water,Lava,Chest, or other block
- local I, data = turtle.inspect()
- if I then
- if data.name ~= "minecraft:water" or data.name ~= "minecraft:lava" then
- if data.name == "minecraft:chest" then
- checkChest()
- else
- turtle.dig()
- end
- turtle.forward()
- checkNear()
- else
- turtle.forward()
- checkNear()
- end
- X = X-1
- end
- end
- if X == 0 then
- if Y > 0 then
- -- Checks if Y is even or odd
- if math.mod(y, 2) == 0 then
- turtle.turnRight()
- local I, data = turtle.inspect()
- if I then
- if data.name ~= "minecraft:water" or data.name ~= "minecraft:lava" then
- if data.name == "minecraft:chest" then
- checkChest()
- else
- turtle.dig()
- end
- turtle.forward()
- else
- turtle.forward()
- end
- Y = Y-1
- turtle.turnRight()
- checkNear()
- else
- end
- end
- end
- end
- end
- --Logic to check if chest has inventory and then mine chest when chest is empty
- function checkChest()
- if turtle.suck() == true then
- checkChest()
- else
- if inventory() > 0 then
- turtle.dig()
- else
- returnHome()
- end
- end
- end
- function checkChestUp()
- if turtle.suckUp() == true then
- checkChestUp()
- else
- if inventory() > 0 then
- turtle.digUP()
- else
- returnHome()
- end
- end
- end
- function checkChestDown()
- if turtle.suckDown() == true then
- checkChestDown()
- else
- if inventory() > 0 then
- turtle.digDown()
- else
- returnHome()
- end
- end
- end
- --Logic to inspect above and below and compare inspected item to list of unwanted items
- function checkNear()
- if inventory() > 1 then
- local Up, dataUp = turtle.inspectUp()
- local Down, dataDown = turtle.inspectDown()
- if Up then
- if dataUp.name == "minecraft:chest" then
- checkChestUp()
- else
- --Logic to compare to list
- print("not a chest")
- end
- end
- if Down then
- if dataDown.name == "minecraft:chest" then
- checkChestDown()
- else
- --Logic to compare to list
- print("not a chest")
- end
- end
- else
- returnHome()
- end
- end
- --Counts the slots in the Turtles inventory to determine if it has room to continue, return's number of empty slots
- function inventory()
- local inv = 0
- for i=1,14 do
- turtle.select(i)
- if turtle.getItemDetail() == nil then
- inv = inv + 1
- end
- end
- turtle.select(16)
- return inv
- end
- --Logic to return home
- function returnHome()
- end
- --Program Started
- term.clear()
- term.setCursorPos(1,1)
- print(" ___ ___ ___")
- print(" / _ \\| _ \\| __|")
- print(" | (_) | /| _|")
- print(" \\___/|_|_\\|___| v0.01")
- print(" ___ _ _ _ ___ _____ __")
- print(" / _ \\| | | |/_\\ | _ \\ _ \\ \\ / /")
- print(" | (_) | |_| / _ \\| / /\\ V /")
- print(" \\__\\_\\\\___/_/ \\_\\_|_\\_|_\\ |_|")
- print()
- print(" REDUX! by. Soulgriever")
- print("function Test")
- checkNear()
Add Comment
Please, Sign In to add comment