SHOW:
|
|
- or go back to the newest paste.
1 | --// turtle-slot [1] Item | |
2 | --// turtle-slot [2] Coal | |
3 | ------------------------------------------------------------------------------------------------------------------------- | |
4 | --CODE------------------------------------------------------------------------------------------------------------------- | |
5 | ------------------------------------------------------------------------------------------------------------------------- | |
6 | --Start height | |
7 | local args = {...} | |
8 | a = 89-1 --Height | |
9 | b = args[1] --Mining Time | |
10 | shell.run("label set Control") | |
11 | ||
12 | rednet.open("right") | |
13 | for i = 1, 1000 do | |
14 | rednet.send(i,b) | |
15 | end | |
16 | ||
17 | --Startcheck: Fuel------------------------------------------------------------------------------------------------------- | |
18 | function Start() | |
19 | while turtle.getFuelLevel()<(2*a+1000) do | |
20 | turtle.select(2) | |
21 | turtle.digDown() | |
22 | turtle.placeDown() | |
23 | turtle.suckDown() | |
24 | shell.run("refuel all") | |
25 | turtle.select(2) | |
26 | turtle.digDown() | |
27 | end | |
28 | end | |
29 | ||
30 | --Items to Ender-Chest--------------------------------------------------------------------------------------------------- | |
31 | function Item() | |
32 | turtle.select(1) | |
33 | turtle.placeDown() | |
34 | for i=3,16,1 do | |
35 | turtle.select(i) | |
36 | turtle.dropDown() | |
37 | sleep(0.5) | |
38 | end | |
39 | turtle.select(1) | |
40 | turtle.digDown() | |
41 | end | |
42 | ||
43 | --Mining actions--------------------------------------------------------------------------------------------------------- | |
44 | function forward() | |
45 | while turtle.forward()==false do | |
46 | sleep(0.5) | |
47 | end | |
48 | end | |
49 | ||
50 | function up() | |
51 | while turtle.up()==false do | |
52 | sleep(0.5) | |
53 | end | |
54 | end | |
55 | ||
56 | --Mining Forms----------------------------------------------------------------------------------------------------------- | |
57 | function Mine() | |
58 | Start() | |
59 | turtle.digDown() | |
60 | turtle.turnRight() | |
61 | turtle.dig() | |
62 | turtle.turnLeft() | |
63 | turtle.dig() | |
64 | turtle.turnLeft() | |
65 | turtle.dig() | |
66 | while turtle.down()==true do | |
67 | turtle.digDown() | |
68 | turtle.dig() | |
69 | turtle.turnRight() | |
70 | turtle.dig() | |
71 | turtle.turnRight() | |
72 | turtle.dig() | |
73 | turtle.down() | |
74 | turtle.digDown() | |
75 | turtle.dig() | |
76 | turtle.turnLeft() | |
77 | turtle.dig() | |
78 | turtle.turnLeft() | |
79 | turtle.dig() | |
80 | end | |
81 | turtle.turnRight() | |
82 | for p=1,a,1 do | |
83 | up() | |
84 | end | |
85 | Item() | |
86 | end | |
87 | ||
88 | function Next() | |
89 | up() | |
90 | for i=1,4,1 do | |
91 | forward() | |
92 | end | |
93 | turtle.digDown() | |
94 | turtle.down() | |
95 | end | |
96 | ||
97 | ------------------------------------------------------------------------------------------------------------------------- | |
98 | --Actions---------------------------------------------------------------------------------------------------------------- | |
99 | ------------------------------------------------------------------------------------------------------------------------- | |
100 | for t=1,b,1 do | |
101 | for k=1,4,1 do | |
102 | Mine() | |
103 | Next() | |
104 | end | |
105 | end |