View difference between Paste ID: adggVFJ4 and 263DTtgp
SHOW: | | - or go back to the newest paste.
1
local check, first, tc
2
local waiting = false
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
    check = {colors.blue,
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
    tc = colors.yellow
25
  else
26
    tc = colors.blue
27
  end
28
end
29
30
31
32
while true do
33
34
  if first == true then
35
      print("waiting for others")
36-
      if redstone.getBundledInput
36+
      if redstone.getBundledInput(
37-
				("back",check[1]) 
37+
				  "back",check[1]) 
38-
      and redstone.getBundledInput
38+
      and redstone.getBundledInput(
39-
                ("back",check[2]) 
39+
                  "back",check[2]) 
40
      then
41
      	print("digging")
42
      	turtle.dig()
43-
        redstone.setBundledOutput
43+
        redstone.setBundledOutput(
44-
                      ("back", 0)
44+
                        "back", 0)
45
        sleep(1)
46
        print("planting")
47-
        redstone.setAnalogOutput
47+
        redstone.setAnalogOutput(
48-
                     ("left",15)
48+
                       "left",15)
49
        sleep(1)
50-
        redstone.setAnalogOutput
50+
        redstone.setAnalogOutput(
51-
                      ("left",0)
51+
                        "left",0)
52
        first = false
53
    end
54
  else
55
    print("waiting for growth")
56
    local m,j = turtle.inspect()
57
    if m == true then
58
      if j.metadata == 7 then
59-
        redstone.setBundledOutput
59+
        redstone.setBundledOutput(
60-
                    ("back", tc)
60+
                      "back", tc)
61
      end
62
    end
63
  end
64
65
  sleep(1)
66
67
end