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