View difference between Paste ID: zdR8R63a and 2Q2wxwCq
SHOW: | | - or go back to the newest paste.
1
function digIt()
2
  while turtle.detect() do
3
    turtle.dig()
4
    os.sleep(0.5)
5
  end
6
  turtle.forward()
7
  while turtle.detectDown() or turtle.detectUp() do
8
    turtle.digUp()
9
    turtle.digDown()
10
  end
11
end
12
 
13
function placeTorch()
14
  turtle.down()
15
  turtle.back()
16
  turtle.select(16)
17
  turtle.placeUp()
18
  turtle.forward()
19
  turtle.up()
20
end
21
 
22
function side(m)
23
 for i = 1, 1 do
24
   digIt()
25
 end
26
 if m % 2 == 0 then
27
   turtle.turnRight()
28
   digIt()
29
 else
30
   turtle.turnLeft()
31
   digIt()
32
 end
33
end
34
35
--function store()
36
--  if turtle.getItemCount(16) ~= 0 then
37
--    turtle.dig()
38
--    turtle.select(1)
39
--    turtle.place()
40
--    for i = 3, 16 do
41
--      turtle.select(i)
42
--      turtle.drop()
43
--    end
44
--    turtle.select(1)
45
--    turtle.dig()
46
--  end
47
--end
48
 
49
 
50
local run = 0
51
local length = 0
52
local j = 0
53
local k = 0
54
local m = 0
55
local turn = 0
56
 
57
term.write("Number of Strips: ")
58
run = read()
59
60
term.write("Length of Strips: ")
61
length = read()
62
length = length - 4
63
64
 
65
side(m)
66
m = m + 1
67
 
68
for iter = 1, run do
69
  if iter == 2 then
70
    length = length - 1
71
  end
72
  for i = 1, length do
73
  
74
    k = i - 1
75
    j = k % 7
76
    
77
    if j == 1 then
78
--      placeTorch()
79
    end
80
81
    if turn == (length - 1) then
82
      side(m)
83
      side(m)
84
      m = m + 1
85
      turn = 0
86
--      store()
87
    else
88
      turn = turn + 1
89
--      store()
90
    end
91
    digIt()    
92
  end
93
end