SHOW:
|
|
- or go back to the newest paste.
1 | -- Awake | |
2 | - | local Y = 64 |
2 | + | print("Chunk follow client awake: Hello World!") |
3 | - | print("Mining client awake: Hello World!") |
3 | + | |
4 | -- Setup wireless | |
5 | local modem = peripheral.wrap("right") | |
6 | -- 5 Server -> Client | |
7 | -- 6 Client -> Server | |
8 | modem.open(11) | |
9 | modem.open(12) | |
10 | print("Channel 11 and 12 are open") | |
11 | ||
12 | -- Setup receiving wireless messages | |
13 | function WaitForMessage(messageCompare) | |
14 | while true do | |
15 | local a,b,c,d,e,f = os.pullEvent("modem_message") | |
16 | print("Message received: ") | |
17 | print(e) | |
18 | if(e == messageCompare) then | |
19 | print("Message accepted") | |
20 | break | |
21 | end | |
22 | end | |
23 | end | |
24 | ||
25 | -- Forward shorthand | |
26 | - | -- Setup sending wireless messages |
26 | + | |
27 | - | function SendMessage(message) |
27 | + | |
28 | - | modem.transmit(12, 11, message) |
28 | + | |
29 | end | |
30 | end | |
31 | - | -- Down shorthand |
31 | + | |
32 | - | function Down() |
32 | + | |
33 | - | while not turtle.down() do |
33 | + | |
34 | - | if turtle.detectDown() then turtle.digDown() end |
34 | + | print("Waiting for start of next cycle") |
35 | - | turtle.attackDown() |
35 | + | |
36 | print("Moving forward...") | |
37 | - | turtle.dig() |
37 | + | |
38 | Forward() | |
39 | Forward() | |
40 | - | -- Up shorthand |
40 | + | |
41 | - | function Up() |
41 | + | |
42 | - | while not turtle.up() do |
42 | + | |
43 | - | if turtle.detectUp() then turtle.digUp() end |
43 | + | |
44 | - | turtle.attackUp() |
44 | + | |
45 | ||
46 | - | turtle.dig() |
46 | + | |
47 | read() |