Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- moveCount=0
- turtle.saveForward = function()
- moveCount = moveCount + 1
- if moveCount % 100 == 0 then
- turtle.refuelNow()
- end
- while not turtle.forward() do
- end
- end
- turtle.saveDig = function()
- while turtle.detect() do
- turtle.dig()
- sleep(0.45)
- end
- end
- turtle.saveDigDown = function()
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.45)
- end
- end
- turtle.refuelNow = function()
- while turtle.getFuelLevel() < 150 do
- for i=1,16 do
- turtle.select(i)
- turtle.refuel()
- end
- end
- end
- turtle.cleanInventory = function(mod)
- -- turn around, dig 3 forward and drop all shit here
- turtle.turnRight()
- turtle.turnRight()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- if mod==0 then
- turtle.saveDig()
- turtle.saveForward()
- end
- turtle.saveDigDown()
- -- drop all but one
- --turtle.dropDown( turtle.getItemCount(i)-1 )
- for j = 6,16 do
- turtle.select(j)
- local dropItem = true
- for i = 1,5 do
- -- compare to good
- if turtle.compareTo(i) then
- -- drop all trash
- dropItem = false
- end
- end
- if dropItem then
- turtle.dropDown()
- end
- end
- -- go back to original pos
- turtle.turnRight()
- turtle.turnRight()
- if mod==0 then
- turtle.saveDig()
- turtle.saveForward()
- end
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- end
- for i = 0,20 do
- for b = 0,10 do
- print("Depth: " .. i .. ", Row: " .. b .. ", Fuel: " .. turtle.getFuelLevel())
- turtle.cleanInventory(b%2==0)
- for a = 0,30 do
- turtle.turnLeft()
- turtle.saveDig()
- turtle.turnRight()
- turtle.saveDig()
- turtle.turnRight()
- turtle.saveDig()
- turtle.turnLeft()
- turtle.saveForward()
- end
- if b%2==0 then
- turtle.turnLeft()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.saveDig()
- turtle.saveForward()
- turtle.turnRight()
- end
- end
- turtle.saveDigDown()
- turtle.down()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement