View difference between Paste ID: rDRrDmGA and vSqGXNhB
SHOW: | | - or go back to the newest paste.
1
-- Created by CyaNox
2
3
updateInterval = 0.2
4
update = os.startTimer(updateInterval)
5-
	local e, p1,p2,p3,p4,p5,p6 = os.pullEvent()
5+
6
while true do
7
	local e,p1 = os.pullEvent()
8
	if e == "timer" then
9
    if p1 == update then
10
      if redstone.getInput("back") then
11
        if turtle.detect() then
12
          for i=1,16 do
13
            turtle.select(i)
14
            turtle.dropUp()
15
          end
16
        else
17
          turtle.select(1)
18
          turtle.place()
19
        end
20
      else
21
        if turtle.detect() then
22
          for i=1,16 do
23
            turtle.select(i)
24
            turtle.dropUp()
25
          end
26
          turtle.select(1)
27
          turtle.dropUp()
28
          turtle.dig()
29
        end
30
      end
31
      update = os.startTimer(updateInterval)
32
    end
33
  end
34
end