Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Efficent Dig
- --By Nurall
- --EfficentDigV1
- --use: turtle will dig in shafts in a patern as not to miss any areas
- --use: digging in a 24x24 area the turtle will compare ore found with slot 1-4
- --use: if that ore is not foud in the ignored slots then it will be mined
- --Var
- local z = 1
- local t = 1
- local y = 100 --altitude
- local i = 0
- local x = 0
- local k = 0
- --function
- function MineDown()
- for z = 1, y do
- while not turtle.down() do
- turtle.dig()
- turtle.attack()
- end
- FullStorage()
- RefuelDigger()
- for t = 1, 4 do
- turtle.select(t)
- if not turtle.compare() then
- turtle.dig()
- end
- turtle.turnRight()
- end
- end
- for z = 1, y do
- while not turtle.up() do
- turtle.dig()
- turtle.attack()
- end
- end
- end
- function RefuelDigger()
- if turtle.getFuelLevel() < 30 then
- if turtle.getItemCount(16) == 1 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(15)
- if turtle.placeUp()then
- turtle.select(16)
- turtle.suckUp()
- turtle.select(15)
- turtle.digUp()
- end
- else
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- end
- function FullStorage()
- if turtle.getItemCount(13) > 0 then
- turtle.select(14)
- if turtle.placeUp() then
- for i = 5, 13 do
- turtle.select(i)
- turtle.dropUp()
- end
- turtle.select(14)
- turtle.digUp()
- end
- end
- end
- function Skip()
- for i = 1, 5 do
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- end
- end
- function RowStart()
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, 25 do
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- end
- turtle.turnLeft()
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- turtle.turnLeft()
- RefuelDigger()
- end
- --program
- for k = 1, 5 do
- --row 1
- for x = 1, 5 do
- Skip()
- MineDown()
- end
- RowStart()
- --row 2
- for i = 1, 2 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- MineDown()
- for x = 1, 4 do
- Skip()
- MineDown()
- end
- for i = 1, 3 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- RowStart()
- --row 3
- for i = 1, 4 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- MineDown()
- for x = 1, 4 do
- Skip()
- MineDown()
- end
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- RowStart()
- --row 4
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- MineDown()
- for x = 1, 4 do
- Skip()
- MineDown()
- end
- for i = 1, 4 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- RowStart()
- --row 5
- for i = 1, 3 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- MineDown()
- for x = 1, 4 do
- Skip()
- MineDown()
- end
- for i = 1, 2 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- RowStart()
- end
- turtle.turnLeft()
- for i = 1, 24 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement