SHOW:
|
|
- or go back to the newest paste.
1 | while true do | |
2 | local action = math.random(1,8) | |
3 | ||
4 | ||
5 | if action == 1 then | |
6 | turtle.turnLeft() | |
7 | end | |
8 | ||
9 | if action == 2 then | |
10 | turtle.turnRight() | |
11 | end | |
12 | ||
13 | if action == 3 then | |
14 | local distance = math.random(1,5) | |
15 | for i = 1,distance do | |
16 | - | turtle.dig() |
16 | + | |
17 | if turtle.detectDown() then | |
18 | turtle.select(1) | |
19 | else | |
20 | turtle.down() | |
21 | end | |
22 | end | |
23 | end | |
24 | ||
25 | if action == 4 then | |
26 | local distance = math.random(1,5) | |
27 | for i = 1,distance do | |
28 | turtle.forward() | |
29 | - | turtle.dig() |
29 | + | |
30 | turtle.select(1) | |
31 | else | |
32 | turtle.down() | |
33 | end | |
34 | end | |
35 | end | |
36 | ||
37 | if action == 5 then | |
38 | local distance = math.random(1,5) | |
39 | for i = 1,distance do | |
40 | turtle.forward() | |
41 | if turtle.detectDown() then | |
42 | - | turtle.dig() |
42 | + | |
43 | else | |
44 | turtle.down() | |
45 | end | |
46 | end | |
47 | end | |
48 | ||
49 | if action == 6 then | |
50 | local distance = math.random(1,5) | |
51 | for i = 1,distance do | |
52 | turtle.forward() | |
53 | if turtle.detectDown() then | |
54 | turtle.select(1) | |
55 | - | turtle.dig() |
55 | + | |
56 | turtle.down() | |
57 | end | |
58 | end | |
59 | end | |
60 | ||
61 | if action == 7 then | |
62 | local distance = math.random(1,5) | |
63 | for i = 1,distance do | |
64 | turtle.up() | |
65 | end | |
66 | end | |
67 | ||
68 | - | turtle.digUp() |
68 | + | |
69 | local distance = math.random(1,5) | |
70 | for i = 1,distance do | |
71 | turtle.down() | |
72 | end | |
73 | end | |
74 | end |