View difference between Paste ID: ZhyjRS2X and zsUVQLRg
SHOW: | | - or go back to the newest paste.
1
-- AM2 Chunk Eater Controller
2
-- Save as 'startup' file.
3
local f = 0
4
local l = 0
5
local r = 0
6
local b = 0
7
local default = 0
8-
local backvar = 0
8+
local back = 0
9
local wait = 2
10
11
function front()
12
 while(f<30) do
13
  redstone.setOutput("back", true)
14
  sleep(1)
15
  redstone.setOutput("back", false)
16
  f = f +1
17
  sleep(wait)
18
 end
19
 f = 0
20
end
21
22
function left()
23
 while(l<4) do
24
  redstone.setOutput("left", true)
25
  sleep(1)
26
  redstone.setOutput("left", false)
27
  l = l +1
28
  sleep(wait)
29
 end
30
 l = 0
31
end
32
33
function right()
34
 while(r<2) do
35
  redstone.setOutput("right", true)
36
  sleep(1)
37
  redstone.setOutput("right", false)
38
  r = r +1
39
  sleep(wait)
40
 end
41
 r = 0
42
end
43
44
function back()
45
 while(b<2) do
46
  redstone.setOutput("front", true)
47
  sleep(1)
48
  redstone.setOutput("front", false)
49
  b = b +1
50
  sleep(wait)
51
 end
52
 b = 0
53
end
54
55
while(true) do
56-
 while(default<10) do
56+
 while(back<4) do
57-
  -- move 20 forward
57+
58-
  front()
58+
59-
  -- move 3 back
59+
  back = back + 1
60
 end
61-
  -- move 3 left
61+
 back = 0
62-
  left() 
62+
63-
  -- move 20 forward
63+