View difference between Paste ID: WXaGZYHF and MdF5avUS
SHOW: | | - or go back to the newest paste.
1
local delay = 15
2
3
local match = false
4
5
while true do
6
  match = false
7-
  if turtle.detect() then
7+
  if turtle.detectUp() then
8
    for x=1,16,1 do
9
      if turtle.getItemCount(x) > 0 then
10
        turtle.select(x)
11-
        if turtle.compare() then
11+
        if turtle.compareUp() then
12
          match = true
13
        end
14
      end
15
    end
16
  end
17
  
18
  if not match then
19-
    turtle.dig()
19+
    turtle.digUp()
20
  end
21
  
22
  os.sleep(delay)
23
end