SHOW:
|
|
- or go back to the newest paste.
1 | local slot = 1 | |
2 | turtle.select(slot) | |
3 | ||
4 | function Ensure() | |
5 | if turtle.getItemCount(slot) == 0 then | |
6 | slot = slot + 1 | |
7 | if slot == 17 then slot = 1 end | |
8 | turtle.select(slot) | |
9 | if turtle.getItemCount(slot) == 0 then | |
10 | print("Insert more >>") | |
11 | read() | |
12 | end | |
13 | end | |
14 | end | |
15 | ||
16 | function F() | |
17 | Ensure() | |
18 | turtle.placeDown() | |
19 | turtle.forward() | |
20 | end | |
21 | ||
22 | function U() | |
23 | turtle.up() | |
24 | end | |
25 | ||
26 | function L() | |
27 | turtle.turnLeft() | |
28 | end | |
29 | ||
30 | function R() | |
31 | turtle.turnRight() | |
32 | end | |
33 | ||
34 | function FMax() | |
35 | while not turtle.detect() do | |
36 | F() | |
37 | end | |
38 | end | |
39 | ||
40 | turtle.forward() | |
41 | turtle.down() | |
42 | turtle.turnLeft() | |
43 | turtle.turnLeft() | |
44 | -- | |
45 | local count = 0 | |
46 | while true do | |
47 | while turtle.back() do | |
48 | Ensure() | |
49 | turtle.place() | |
50 | count = 0 | |
51 | end | |
52 | turtle.turnRight() | |
53 | count = count + 1 | |
54 | if count == 3 then | |
55 | U() | |
56 | Ensure() | |
57 | turtle.placeDown() | |
58 | break | |
59 | end | |
60 | end | |
61 |