Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is the standard 4 square mining setup
- --Designed to mine a 1x2x2 along with checking all 6 blocks adjacent to them for ores.
- --Number of blocks you want to ignore
- local IgnoreSlots = 4
- function digFwd()
- if turtle.detect() then
- while not turtle.dig() do
- sleep(.5)
- end
- return true
- else
- print("No block forward")
- return false
- end
- end
- function digUp()
- if turtle.detectUp() then
- while not turtle.digUp() do
- sleep(.5)
- end
- return true
- else
- print("No block up")
- return false
- end
- end
- function digDown()
- if turtle.detectDown() then
- while not turtle.digDown() do
- sleep(.5)
- end
- return true
- else
- print("No block down")
- return false
- end
- end
- local function moveFwd()
- if turtle.detect() == false then
- while not turtle.forward() do
- sleep(.5)
- end
- end
- end
- local function moveUp()
- if turtle.detectUp() == false then
- while not turtle.Up() do
- sleep(.5)
- end
- end
- end
- local function moveDown()
- if turtle.detectDown() == false then
- while not turtle.Down() do
- sleep(.5)
- end
- end
- end
- local function Refuel()
- if turtle.getFuelLevel() < 10 then
- turtle.select(16)
- return turtle.refuel(10)
- else
- return true
- end
- end
- local function DepositChest()
- print("Depositing the Load...")
- for i = IgnoreSlots + 1,15 do
- turtle.select(i)
- turtle.drop()
- end
- end
- local function checkFwd()
- TimesChecked = 0
- for i = 1,tonumber(IgnoreSlots) do
- turtle.select(i)
- if turtle.compare() == false then
- TimesChecked = TimesChecked + 1
- if TimesChecked == IgnoreSlots then
- digFwd()
- end
- else
- return
- end
- end
- end
- local function checkDown()
- TimesChecked = 0
- for i = 1,tonumber(IgnoreSlots) do
- turtle.select(i)
- if turtle.compareDown() == false then
- TimesChecked = TimesChecked + 1
- if TimesChecked == IgnoreSlots then
- digDown()
- end
- else
- return
- end
- end
- end
- local function checkUp()
- TimesChecked = 0
- for i = 1,tonumber(IgnoreSlots) do
- turtle.select(i)
- if turtle.compareUp() == false then
- TimesChecked = TimesChecked + 1
- if TimesChecked == IgnoreSlots then
- digUp()
- end
- else
- return
- end
- end
- end
- local function checkLeft()
- turtle.turnLeft()
- checkFwd()
- turtle.turnRight()
- end
- local function checkRight()
- turtle.turnRight()
- checkFwd()
- turtle.turnLeft()
- end
- local function checkSides()
- checkLeft()
- checkRight()
- end
- local function rodeoMine(turns)
- for i=1,turns do
- checkFwd()
- moveFwd()
- checkSides()
- checkDown()
- checkUp()
- moveUp()
- checkSides()
- checkUp()
- checkFwd()
- moveFwd()
- checkSides()
- checkUp()
- checkDown()
- moveDown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement