Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function digAndMove()
- local i = 1
- local w = 5 -- width
- local r = 5 -- row
- local h = 1 -- height
- local s = 1
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- i = i + 1
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight() -- start in corner so that the whole 5x5 can be cleaned
- while h < 10 do
- while i < w do
- turtle.dig()
- turtle.forward() -- start cleaning
- i = i + 1
- turtle.dig()
- if i % 2 == 0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- turtle.forward()
- turtle.turnLeft()
- i = 1
- turtle.forward()
- turtle.turnRight()
- i = 1
- turtle.up()
- h = h + 1
- end
- for count = 1, h do
- turtle.down()
- end
- end
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.select(2)
- turtle.dropDown()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.select(1)
- turtle.place()
- turtle.up()
- end
- end
- while true do
- digAndMove()
- sleep(60) -- Sleep for 1 minute
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement