SHOW:
|
|
- or go back to the newest paste.
1 | bool=true | |
2 | ||
3 | while bool==true do | |
4 | if rs.getInput("back", true) then | |
5 | print ("Waiting") | |
6 | sleep (1) | |
7 | else | |
8 | print ("Let's Roll!") | |
9 | bool=false | |
10 | end | |
11 | end | |
12 | ||
13 | X=66 | |
14 | ||
15 | print ("Startup Functions Activating") | |
16 | print ("Going to lowest point") | |
17 | ||
18 | turtle.select(1) | |
19 | turtle.dig() | |
20 | turtle.select(4) | |
21 | turtle.back() | |
22 | ||
23 | turtle.select(2) | |
24 | turtle.dig() | |
25 | turtle.select(4) | |
26 | turtle.back() | |
27 | ||
28 | while true do | |
29 | local mobsPresent = turtle.attackDown() | |
30 | local digSuccess = turtle.digDown() | |
31 | local movementSuccess = turtle.down() | |
32 | ||
33 | if not mobsPresent and not digSuccess and not movementSuccess then | |
34 | break | |
35 | end | |
36 | end | |
37 | ||
38 | for b = 1, X do | |
39 | turtle.digUp() | |
40 | while not turtle.up() do | |
41 | turtle.attackUp() | |
42 | end | |
43 | end | |
44 | ||
45 | while not turtle.forward() do | |
46 | turtle.dig() | |
47 | turtle.attack() | |
48 | end | |
49 | ||
50 | print ("---------------------------") | |
51 | print ("Starting ORE FINDING PROTOCOLS!") | |
52 | print ("---------------------------") | |
53 | ||
54 | ||
55 | ||
56 | while true do | |
57 | ||
58 | ||
59 | moves = 0 | |
60 | ||
61 | ore = false | |
62 | ||
63 | turtle.select(3) | |
64 | ore = turtle.compareDown() | |
65 | turtle.select(4) | |
66 | ||
67 | while ore == false and moves < 66 do | |
68 | turtle.digDown() | |
69 | moves = moves + 1 | |
70 | while not turtle.down() do | |
71 | turtle.attack() | |
72 | end | |
73 | sleep(.5) | |
74 | turtle.select(3) | |
75 | ore = turtle.compareDown() | |
76 | turtle.select(4) | |
77 | end | |
78 | ||
79 | for q=1, moves do | |
80 | turtle.digUp() | |
81 | while not turtle.up() do | |
82 | turtle.attack() | |
83 | turtle.digUp() | |
84 | end | |
85 | end | |
86 | ||
87 | ||
88 | ||
89 | turtle.dig() | |
90 | while not turtle.forward() do | |
91 | turtle.attack() | |
92 | turtle.dig() | |
93 | end | |
94 | ||
95 | ||
96 | print ("Dropping off items") | |
97 | ||
98 | turtle.dig() | |
99 | turtle.attack() | |
100 | ||
101 | ||
102 | turtle.select(1) | |
103 | while not turtle.place() do | |
104 | turtle.select(4) | |
105 | turtle.attack() | |
106 | turtle.dig() | |
107 | turtle.select(1) | |
108 | end | |
109 | ||
110 | for dropslot = 4, 16 do | |
111 | turtle.select(dropslot) | |
112 | turtle.drop() | |
113 | end | |
114 | ||
115 | turtle.select(1) | |
116 | ||
117 | turtle.dig() | |
118 | ||
119 | turtle.select(4) | |
120 | ||
121 | ||
122 | Fuel = turtle.getFuelLevel() | |
123 | ||
124 | print ("Fuel level is: "..Fuel) | |
125 | ||
126 | if Fuel >= 8192 then | |
127 | ||
128 | print ("Fuel level is above minimum safe limit.") | |
129 | ||
130 | else | |
131 | ||
132 | print ("Fuel is below safe limit! Refueling!") | |
133 | ||
134 | turtle.select(4) | |
135 | turtle.dig() | |
136 | turtle.select(2) | |
137 | while not turtle.place() do | |
138 | turtle.select(4) | |
139 | turtle.dig() | |
140 | turtle.attack() | |
141 | turtle.select(2) | |
142 | end | |
143 | turtle.suck() | |
144 | turtle.refuel() | |
145 | turtle.dig() | |
146 | print ("Refueled up! Continuing!") | |
147 | ||
148 | turtle.select(4) | |
149 | ||
150 | end | |
151 | ||
152 | ||
153 | ||
154 | ||
155 | end |