Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local det
- local c = 0
- function detup()
- if turtle.detectUp() then
- det = 1
- c = c + 1
- else
- det = 0
- end
- end
- function dig()
- turtle.digDown()
- turtle.dig()
- turtle.forward()
- print(c)
- end
- function detupdig()
- detup()
- dig()
- detup()
- print(c)
- end
- function go1()
- while (c == 0 or c == 1
- or c == 3 or c == 5
- or c == 7 or c == 9
- or c == 11 or c == 13
- or c == 15 or c == 17
- or c == 19) do
- detupdig()
- print(c)
- end
- end
- function sharpleft()
- while (c == 2 or c == 6 or c == 10 or c == 14 or c == 18) do
- turtle.turnLeft()
- dig() turtle.digDown()
- turtle.dig() turtle.down() turtle.dig() turtle.up()
- turtle.turnLeft()
- c = c + 1
- print(c)
- end
- end
- function largeright()
- while (c == 4 or c == 8 or c == 12 or c == 16) do
- turtle.turnRight()
- dig()dig()
- turtle.turnRight()
- dig()dig()
- c = c + 1
- print(c)
- end
- end
- function home()
- while (c == 20) do
- turtle.turnLeft()
- detupdig()
- end
- while
- (c == 21) or (c == 22)
- or (c == 23) or (c == 24)
- or (c == 25) or (c == 26)
- or (c == 27) do
- detupdig()
- end
- print(c)
- end
- function vider()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.down()
- for i = 1,16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- turtle.up()
- turtle.turnLeft()
- end
- while true do
- go1()
- sharpleft()
- largeright()
- home()
- while c == 28 do
- vider()
- c = -1
- end
- while c == -1 do
- detupdig()
- print(c)
- end
- print(c)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement