SHOW:
|
|
- or go back to the newest paste.
1 | - | if rs.getInput("back") then |
1 | + | function down() |
2 | - | if turtle.detectDown() then |
2 | + | i = 2 |
3 | - | turtle.digDown() |
3 | + | while i > 0 do |
4 | - | else |
4 | + | if turtle.detectDown() then |
5 | - | turtle.down() |
5 | + | turtle.digDown() |
6 | - | end |
6 | + | turtle.down(1) |
7 | - | if turtle.detectDown() then |
7 | + | i = i - 1 |
8 | - | turtle.digDown() |
8 | + | else |
9 | - | else |
9 | + | turtle.down(1) |
10 | - | turtle.down() |
10 | + | i = i - 1 |
11 | - | end |
11 | + | end |
12 | - | |
12 | + | end |
13 | - | |
13 | + | i = 0 |
14 | - | |
14 | + | forward() |
15 | - | |
15 | + | end |
16 | ||
17 | function forward() | |
18 | i = 15 | |
19 | while i > 0 do | |
20 | while turtle.detectDown() do | |
21 | turtle.digDown() | |
22 | end | |
23 | ||
24 | while turtle.detect() do | |
25 | turtle.dig() | |
26 | sleep(0.5) | |
27 | end | |
28 | ||
29 | while turtle.detectUp() do | |
30 | turtle.digUp() | |
31 | end | |
32 | turtle.forward(1) | |
33 | i = i - 1 | |
34 | end | |
35 | i = 0 | |
36 | turn() | |
37 | end | |
38 | ||
39 | function turn() | |
40 | while turtle.detectUp() do | |
41 | turtle.digUp() | |
42 | end | |
43 | ||
44 | if turtle.detectDown() then | |
45 | turtle.digDown() | |
46 | turtle.down(1) | |
47 | else | |
48 | turtle.down(1) | |
49 | end | |
50 | ||
51 | turtle.turnLeft() | |
52 | turtle.turnLeft() | |
53 | down() | |
54 | end | |
55 | ||
56 | --Programm Start-- | |
57 | ||
58 | rednet.open("right") | |
59 | ||
60 | while true do | |
61 | if rs.getInput("back") then | |
62 | turtle.refuel() | |
63 | x = "Start" | |
64 | rednet.send(6476, x) | |
65 | rednet.send(6477, x) | |
66 | rednet.send(6478, x) | |
67 | rednet.send(6479, x) | |
68 | rednet.send(6480, x) | |
69 | rednet.send(6481, x) | |
70 | rednet.send(6482, x) | |
71 | rednet.send(6483, x) | |
72 | rednet.send(6484, x) | |
73 | rednet.send(6485, x) | |
74 | rednet.send(6486, x) | |
75 | rednet.send(6487, x) | |
76 | rednet.send(6488, x) | |
77 | rednet.send(6489, x) | |
78 | rednet.send(6490, x) | |
79 | down() | |
80 | end | |
81 | sleep(0.5) | |
82 | end |