Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dig()
- turtle.digUp()
- turtle.digDown()
- end
- function forward()
- turtle.dig()
- checkGravel()
- turtle.forward()
- end
- function turnRight()
- turtle.turnRight()
- if turtle.detect() then
- turtle.dig()
- checkGravel()
- end
- turtle.forward()
- turtle.turnLeft()
- end
- function resetPos()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- end
- function checkGravel()
- local sucess, data = turtle.inspect()
- os.sleep(0.5)
- while(sucess == true) do
- if data.name == gravel then
- turtle.dig()
- end
- sucess, data = turtle.inspect()
- end
- end
- function main()
- turtle.refuel()
- print(turtle.getFuelLevel())
- print("How long in blocks do you want this mine to be?")
- length = tonumber(read())
- gravel = "minecraft:gravel"
- for i=1,length do
- forward()
- dig()
- for i=0,1 do
- turnRight()
- dig()
- end
- resetPos()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement