View difference between Paste ID: PXpYdyed and JY4N8awu
SHOW: | | - or go back to the newest paste.
1
print("Starting circuit...")
2
while true do
3
turtle.select(1)
4
5
function compare()
6
  if turtle.compareDown() == true then
7
    turtle.forward()
8
  else
9
    turtle.select(2)
10
    if turtle.compareDown() == true then
11
      turtle.turnLeft()
12
      turtle.forward()
13
    else
14
      turtle.select(3)
15
      if turtle.compareDown() == true then
16
        turtle.turnRight()
17
        turtle.forward()
18
      else
19
        turtle.select(4)
20
        if turtle.compareDown() == true then
21
          turtle.turnRight()
22
          turtle.turnRight()
23
          turtle.forward()
24-
          os.shutdown()
24+
25
	  turtle.select(5)
26
	  if turtle.compare() == true then
27
	    turtle.up()
28
	    turtle.forward()
29
	  else
30
	    if turtle.detect() == true then
31
	      turtle.up()
32
	    else
33
	      if turtle.detect() == false and turtle.detectDown() == false then
34
		turtle.down()
35
	      else
36
		if turtle.compareDown() == true then
37
		  turtle.forward()
38
		else
39
		turtle.select(6)
40
		  if turtle.compareDown() == true then 
41
		    turtle.forward()
42
		    turtle.down()
43
		  else
44
          	    os.shutdown()
45
		  end
46
		end
47
	      end
48
	    end
49
	  end
50
        end
51
      end
52
    end
53
  end
54
end
55
compare()
56
end