SHOW:
|
|
- or go back to the newest paste.
1 | refill = function() | |
2 | turtle.select(1) | |
3 | if turtle.getFuelLevel() < 50 then | |
4 | repeat | |
5 | sleep(3) | |
6 | turtle.digUp() | |
7 | turtle.placeUp() | |
8 | turtle.suckUp() | |
9 | turtle.refuel(64) | |
10 | turtle.dropUp() | |
11 | turtle.digUp() | |
12 | until turtle.getFuelLevel() > 50 | |
13 | end | |
14 | end | |
15 | lastempty = function() | |
16 | turtle.digUp() | |
17 | turtle.select(2) | |
18 | turtle.placeUp() | |
19 | for i = 3, 15, 1 | |
20 | do | |
21 | turtle.select(i) | |
22 | turtle.dropUp(64) | |
23 | end | |
24 | turtle.select(2) | |
25 | turtle.digUp() | |
26 | turtle.select(1) | |
27 | end | |
28 | empty = function() | |
29 | if turtle.getItemCount(15) >= 1 then | |
30 | turtle.digUp() | |
31 | turtle.select(2) | |
32 | turtle.placeUp() | |
33 | for i = 3, 15, 1 | |
34 | do | |
35 | turtle.select(i) | |
36 | turtle.dropUp(64) | |
37 | end | |
38 | turtle.select(2) | |
39 | turtle.digUp() | |
40 | turtle.select(1) | |
41 | end | |
42 | end | |
43 | ||
44 | destroy = function() | |
45 | empty() | |
46 | turtle.digDown() | |
47 | turtle.digUp() | |
48 | while turtle.detect() == true do | |
49 | turtle.dig() | |
50 | end | |
51 | end | |
52 | ||
53 | - | staircase = function(start, fin) |
53 | + | staircasedown = function(start, fin) |
54 | refill() | |
55 | for i = fin, start, 1 | |
56 | do | |
57 | destroy() | |
58 | refill() | |
59 | turtle.forward() | |
60 | destroy() | |
61 | refill() | |
62 | turtle.down() | |
63 | end | |
64 | turtle.dig() | |
65 | lastempty() | |
66 | end | |
67 | ||
68 | staircaseup = function(start, fin) | |
69 | refill() | |
70 | for i = fin, start, 1 | |
71 | do | |
72 | destroy() | |
73 | - | staircase(Start, Fin) |
73 | + | |
74 | turtle.forward() | |
75 | destroy() | |
76 | refill() | |
77 | turtle.up() | |
78 | end | |
79 | turtle.dig() | |
80 | lastempty() | |
81 | end | |
82 | ||
83 | term.write("Select Starting Y Coord: ") | |
84 | local Start = read() | |
85 | term.write("Select Ending Y Coord: ") | |
86 | local Fin = read() | |
87 | ||
88 | if Start > Fin then | |
89 | staircasedown(Start, Fin) | |
90 | elseif Fin > Start | |
91 | staircaseup(Start, Fin) | |
92 | end | |
93 | print("Mining Complete") |