SHOW:
|
|
- or go back to the newest paste.
1 | --[[ | |
2 | Miner turtles | |
3 | Preload slots: | |
4 | 12: None | |
5 | 13: Waterproof Pipe | |
6 | 14: Ender Chest | |
7 | 15: Mining Well | |
8 | 16: Lava Generator | |
9 | ||
10 | Chunk Loader Turtles | |
11 | Preload slots: | |
12 | 16: Chunk loader | |
13 | ||
14 | ]]-- | |
15 | ||
16 | rednet.open("right") | |
17 | local func | |
18 | local tArgs = {...} | |
19 | ||
20 | function cleanup() | |
21 | for i = 1,12 do | |
22 | turtle.select(i) | |
23 | turtle.dropDown() | |
24 | end | |
25 | end | |
26 | ||
27 | function place() | |
28 | turtle.up() | |
29 | turtle.select(13) | |
30 | turtle.place() | |
31 | turtle.down() | |
32 | --turtle.select(12) | |
33 | --turtle.placeUp() | |
34 | turtle.select(16) | |
35 | turtle.place() | |
36 | turtle.down() | |
37 | turtle.select(15) | |
38 | turtle.place() | |
39 | turtle.select(14) | |
40 | turtle.placeDown() | |
41 | end | |
42 | ||
43 | function remove() | |
44 | turtle.select(14) | |
45 | turtle.digDown() | |
46 | turtle.select(15) | |
47 | turtle.dig() | |
48 | turtle.up() | |
49 | turtle.select(16) | |
50 | turtle.dig() | |
51 | --turtle.select(12) | |
52 | --turtle.digUp() | |
53 | turtle.up() | |
54 | turtle.select(13) | |
55 | turtle.dig() | |
56 | turtle.down() | |
57 | end | |
58 | ||
59 | function cycle() | |
60 | place() | |
61 | sleep(30) | |
62 | while turtle.getItemCount(1) > 0 do | |
63 | cleanup() | |
64 | sleep(2) | |
65 | end | |
66 | remove() | |
67 | turtle.forward() | |
68 | end | |
69 | ||
70 | function cleancycle() | |
71 | while turtle.getItemCount(1) > 0 do | |
72 | cleanup() | |
73 | sleep(2) | |
74 | end | |
75 | remove() | |
76 | turtle.forward() | |
77 | end | |
78 | ||
79 | function checkIn(fromID) | |
80 | rednet.send(fromID, tArgs[1]) | |
81 | end | |
82 | ||
83 | function chunkLoad() | |
84 | turtle.select(16) | |
85 | turtle.digUp() | |
86 | turtle.select(16) | |
87 | turtle.forward() | |
88 | turtle.placeUp() | |
89 | end | |
90 | ||
91 | while true do | |
92 | local id,msg,dist = rednet.receive() | |
93 | func = loadstring(msg.."(...)") | |
94 | setfenv(func, getfenv()) | |
95 | func(id) | |
96 | rednet.send(id,"Done") | |
97 | end |