View difference between Paste ID: Rj44gJjX and 0NCFpyme
SHOW: | | - or go back to the newest paste.
1
turtle.select(16)
2
richtung=true
3
run=true
4
5
function fGRABEN()
6
  if turtle.detectUp() == true then
7
    turtle.digUp()
8
  end
9
  if turtle.detect() == true then
10
    turtle.dig()
11
  else
12-
    if turtle.detectDown() == true then
12+
13-
      turtle.placeDown()
13+
14-
    end
14+
  turtle.forward()
15
  if turtle.detectDown() == true then
16
    turtle.placeDown()
17
  end
18
end
19
20
while run==true do
21
  for i=1,10 do
22
    fGRABEN()
23
  end
24
  if richtung==true then
25
      turtle.turnLeft()
26
      fGRABEN()
27
      turtle.turnLeft()
28
      richtung=false
29
    else
30
      turtle.turnRight()
31
      fGRABEN()
32
      turtle.turnRight()
33
      richtung=true
34
  end
35
end