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() | |
17 | turtle.forward() | |
18 | if turtle.detectDown() then | |
19 | turtle.select(1) | |
20 | else | |
21 | turtle.down() | |
22 | end | |
23 | end | |
24 | end | |
25 | ||
26 | if action == 4 then | |
27 | local distance = math.random(1,5) | |
28 | for i = 1,distance do | |
29 | turtle.dig() | |
30 | turtle.forward() | |
31 | if turtle.detectDown() then | |
32 | turtle.select(1) | |
33 | else | |
34 | turtle.down() | |
35 | end | |
36 | end | |
37 | end | |
38 | ||
39 | if action == 5 then | |
40 | local distance = math.random(1,5) | |
41 | for i = 1,distance do | |
42 | turtle.dig() | |
43 | turtle.forward() | |
44 | if turtle.detectDown() then | |
45 | turtle.select(1) | |
46 | else | |
47 | turtle.down() | |
48 | end | |
49 | end | |
50 | end | |
51 | ||
52 | if action == 6 then | |
53 | local distance = math.random(1,5) | |
54 | for i = 1,distance do | |
55 | turtle.dig() | |
56 | turtle.forward() | |
57 | if turtle.detectDown() then | |
58 | turtle.select(1) | |
59 | else | |
60 | turtle.down() | |
61 | end | |
62 | end | |
63 | end | |
64 | ||
65 | if action == 7 then | |
66 | local distance = math.random(1,5) | |
67 | for i = 1,distance do | |
68 | turtle.digUp() | |
69 | turtle.up() | |
70 | end | |
71 | end | |
72 | ||
73 | if action == 8 then | |
74 | local distance = math.random(1,5) | |
75 | for i = 1,distance do | |
76 | turtle.down() | |
77 | end | |
78 | end | |
79 | end |