Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fixChunk()
- local i = 2
- turtle.select(2)
- if turtle.detectDown() and not turtle.compareDown() then
- turtle.digDown()
- end
- if not turtle.detectDown() then
- while turtle.getItemCount(i) < 2 do
- i = i+1
- end
- turtle.select(i)
- turtle.placeDown()
- end
- end
- function forward()
- while turtle.detect() do
- turtle.dig()
- sleep(0.5)
- end
- flag = turtle.forward()
- while not flag do
- turtle.attack()
- sleep(0.5)
- flag = turtle.forward()
- end
- end
- function backAndForth()
- local i
- turtle.select(1)
- while turtle.getFuelLevel() < 40 do
- turtle.refuel(1)
- end
- for i=0,14,1 do
- fixChunk()
- forward()
- end
- fixChunk()
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- for i=0,14,1 do
- fixChunk()
- forward()
- end
- fixChunk()
- end
- function lawn()
- local i
- for i = 0,6,1 do
- backAndForth()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- end
- backAndForth()
- turtle.turnLeft()
- for i=1,15,1 do
- forward()
- end
- end
- lawn()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement