View difference between Paste ID: 263DTtgp and 5SFV6uDS
SHOW: | | - or go back to the newest paste.
1-
local check, first
1+
local check, first, tc
2-
local tc = colors.red
2+
3
4
redstone.setBundledOutput("back",0)
5
redstone.setAnalogOutput("left",0)
6
7
local t,p = turtle.inspectDown()
8
if t == true then
9
  if p.metadata == 14 or 
10
     p.metadata == 0 then
11
    first = true
12-
             colors.yellow}
12+
13-
    
13+
             colors.yellow} 
14
  else
15
    first = false
16
    check = {colors.red,
17
            colors.white}
18
  end
19
  if p.metadata == 14 then
20
    tc = colors.red
21
  elseif p.metadata == 0 then
22
    tc = colors.white
23
  elseif p.metadata == 4 then
24-
    if waiting == false then
24+
    tc = colors.yellow
25-
      print("digging")
25+
26-
      turtle.dig()
26+
    tc = colors.blue
27-
      redstone.setBundledOutput("back",0)
27+
28-
      waiting = true
28+
29-
    else
29+
30-
      print("waiting")
30+
31-
      if redstone.getBundledInput("back",
31+
32-
      check[1]) 
32+
33-
      and 
33+
34-
      redstone.getBundledInput("back",
34+
35-
      check[2]) then
35+
      print("waiting for others")
36-
        redstone.setAnalogOutput(
36+
      if redstone.getBundledInput
37-
                        "left",15)
37+
				("back",check[1]) 
38
      and redstone.getBundledInput
39-
        redstone.setAnalogOutput(
39+
                ("back",check[2]) 
40-
                        "left",0)
40+
      then
41
      	print("digging")
42-
        waiting = false
42+
      	turtle.dig()
43
        redstone.setBundledOutput
44
                      ("back", 0)
45
        sleep(1)
46-
    if waiting == false  then
46+
        print("planting")
47-
      local m,j = turtle.inspect()
47+
        redstone.setAnalogOutput
48-
      if m == true then
48+
                     ("left",15)
49-
        if j.metadata == 7 then
49+
50-
          redstone.setBundledOutput(
50+
        redstone.setAnalogOutput
51-
                        "back", tc)
51+
                      ("left",0)
52-
          waiting = true
52+
53-
        end
53+
54
  else
55-
    else
55+
    print("waiting for growth")
56-
      if redstone.getBundledInput("back",
56+
    local m,j = turtle.inspect()
57-
      check[1]) and
57+
    if m == true then
58-
      redstone.getBundledInput("back",
58+
      if j.metadata == 7 then
59-
      check[2]) then
59+
        redstone.setBundledOutput
60-
        waiting = false
60+
                    ("back", tc)
61-
        first = true
61+
62
    end
63-
    end 
63+
64
65
  sleep(1)
66
67
end