View difference between Paste ID: aDdusMTZ and ajtSpkpv
SHOW: | | - or go back to the newest paste.
1-
local function chop4(x)
1+
pastebinlocal function chop4(x)
2
  for i = 1, x do
3
    turtle.forward()
4
    turtle.forward()
5
    turtle.digDown()
6
  end  
7
end
8
9
local function chop5(x)
10
  for i = 1, x do
11
    turtle.digDown()
12
    turtle.forward()
13
    turtle.forward()
14
  end
15
end    
16
17
local function nextRow5()
18
  turtle.forward()
19
  turtle.turnRight()
20
  turtle.forward()
21
  turtle.turnRight()
22
end
23
24
local function nextRow4()  
25
  turtle.turnLeft()
26
  turtle.forward()
27
  turtle.turnLeft()
28
  turtle.forward()
29
end
30
31
local function gotoStart()
32
  turtle.forward()
33
  turtle.up()
34
  turtle.up()
35
  turtle.up()
36
  turtle.turnLeft()
37
  turtle.forward()
38
  turtle.forward()
39
  turtle.forward()
40
  turtle.forward()
41
  turtle.turnRight()
42
end
43
44
local function gotoHome()
45
  turtle.turnLeft()
46
  for i = 1, 14, 1 do
47
    turtle.forward()
48
  end
49
  turtle.turnRight()
50
  turtle.down()
51
  turtle.down()
52
  turtle.down()
53
end
54
  
55
local function harvest(x)
56
  for i = 1, x do
57
    chop4(4)
58
    nextRow5()
59
    chop5(5)
60
    nextRow4()
61
  end
62
end
63
64
local function depositLoop()
65
  turtle.select(1)
66
  turtle.place()
67
  os.sleep(900)
68
  os.reboot()
69
70
gotoStart()
71
harvest(9)
72
gotoHome()