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 | oreFront = false | |
| 63 | ||
| 64 | turtle.select(3) | |
| 65 | ore = turtle.compareDown() | |
| 66 | turtle.select(4) | |
| 67 | ||
| 68 | while ore == false and moves < 66 do | |
| 69 | turtle.digDown() | |
| 70 | moves = moves + 1 | |
| 71 | ||
| 72 | turtle.select(3) | |
| 73 | oreFront = turtle.compare() | |
| 74 | turtle.select(4) | |
| 75 | ||
| 76 | if oreFront == true then | |
| 77 | ||
| 78 | print ("There is diamond in front of me, I shall not mine")
| |
| 79 | ||
| 80 | else | |
| 81 | ||
| 82 | turtle.dig() | |
| 83 | ||
| 84 | end | |
| 85 | ||
| 86 | ||
| 87 | ||
| 88 | ||
| 89 | while not turtle.down() do | |
| 90 | turtle.attack() | |
| 91 | end | |
| 92 | sleep(.5) | |
| 93 | turtle.select(3) | |
| 94 | ore = turtle.compareDown() | |
| 95 | turtle.select(4) | |
| 96 | end | |
| 97 | ||
| 98 | for q=1, moves do | |
| 99 | turtle.digUp() | |
| 100 | while not turtle.up() do | |
| 101 | turtle.attack() | |
| 102 | turtle.digUp() | |
| 103 | end | |
| 104 | end | |
| 105 | ||
| 106 | ||
| 107 | ||
| 108 | turtle.dig() | |
| 109 | while not turtle.forward() do | |
| 110 | turtle.attack() | |
| 111 | turtle.dig() | |
| 112 | end | |
| 113 | ||
| 114 | turtle.dig() | |
| 115 | while not turtle.forward() do | |
| 116 | turtle.attack() | |
| 117 | turtle.dig() | |
| 118 | end | |
| 119 | ||
| 120 | ||
| 121 | print ("Dropping off items")
| |
| 122 | ||
| 123 | turtle.dig() | |
| 124 | turtle.attack() | |
| 125 | ||
| 126 | ||
| 127 | turtle.select(1) | |
| 128 | while not turtle.place() do | |
| 129 | turtle.select(4) | |
| 130 | turtle.attack() | |
| 131 | turtle.dig() | |
| 132 | turtle.select(1) | |
| 133 | end | |
| 134 | ||
| 135 | for dropslot = 4, 16 do | |
| 136 | turtle.select(dropslot) | |
| 137 | turtle.drop() | |
| 138 | end | |
| 139 | ||
| 140 | turtle.select(1) | |
| 141 | ||
| 142 | turtle.dig() | |
| 143 | ||
| 144 | turtle.select(4) | |
| 145 | ||
| 146 | ||
| 147 | Fuel = turtle.getFuelLevel() | |
| 148 | ||
| 149 | print ("Fuel level is: "..Fuel)
| |
| 150 | ||
| 151 | if Fuel >= 8192 then | |
| 152 | ||
| 153 | print ("Fuel level is above minimum safe limit.")
| |
| 154 | ||
| 155 | else | |
| 156 | ||
| 157 | print ("Fuel is below safe limit! Refueling!")
| |
| 158 | ||
| 159 | turtle.select(4) | |
| 160 | turtle.dig() | |
| 161 | turtle.select(2) | |
| 162 | while not turtle.place() do | |
| 163 | turtle.select(4) | |
| 164 | turtle.dig() | |
| 165 | turtle.attack() | |
| 166 | turtle.select(2) | |
| 167 | end | |
| 168 | turtle.suck() | |
| 169 | turtle.refuel() | |
| 170 | turtle.select(2) | |
| 171 | turtle.dig() | |
| 172 | turtle.dig() | |
| 173 | turtle.dig() | |
| 174 | turtle.dig() | |
| 175 | print ("Refueled up! Continuing!")
| |
| 176 | ||
| 177 | turtle.select(4) | |
| 178 | ||
| 179 | end | |
| 180 | ||
| 181 | ||
| 182 | ||
| 183 | ||
| 184 | end |