SHOW:
|
|
- or go back to the newest paste.
| 1 | -- -------------------------------------------------------------------------- -- | |
| 2 | - | -- NetherTower : RRMkQrvf |
| 2 | + | -- Strip Miner : BHGp2V48 |
| 3 | -- | |
| 4 | - | -- Turtle script to build a 3x3 tower to the Nether ceiling -- beware of falling |
| 4 | + | -- Turtle script to dig out a strip mine. Starting from initial position a |
| 5 | - | -- lava!!! |
| 5 | + | -- 1x2x8 tunnel is dug out with a torch either end, bridging gaps. At the end of |
| 6 | -- each tunnel the turtle will dig out 3 to the left and then start the next | |
| 7 | -- 1x2x8 tunnel to the left again. This is repeated 'till we're out of fuel, torches | |
| 8 | -- or room. | |
| 9 | -- | |
| 10 | -- -------------------------------------------------------------------------- -- | |
| 11 | -- | |
| 12 | -- INVENTORY: | |
| 13 | -- [1][2][3][4] | |
| 14 | -- [5][6][7][8] | |
| 15 | -- [9][A][B][C] | |
| 16 | - | -- Rest should be tower material. |
| 16 | + | |
| 17 | -- | |
| 18 | -- 1 : Fuel | |
| 19 | -- 2 : Torches | |
| 20 | - | local tArgs = { ... }
|
| 20 | + | -- 3 : Bridge material |
| 21 | - | local height = 0 |
| 21 | + | -- 4 : |
| 22 | -- Rest should be empty. | |
| 23 | - | local function PrintHelp() |
| 23 | + | |
| 24 | - | print( "Usage:" ) |
| 24 | + | |
| 25 | - | print( "NetherTower <height>" ) |
| 25 | + | |
| 26 | - | print( " height -- starting height of turtle." ) |
| 26 | + | |
| 27 | if turtle.getFuelLevel() < 64 and turtle.getItemCount( 1 ) > 1 then | |
| 28 | turtle.select( 1 ) | |
| 29 | turtle.refuel( 1 ) | |
| 30 | end | |
| 31 | return | |
| 32 | end | |
| 33 | ||
| 34 | local function PlaceTorch() | |
| 35 | if turtle.getItemCount( 2 ) > 1 then | |
| 36 | turtle.select( 2 ) | |
| 37 | turtle.place() | |
| 38 | - | -- Check the commandline |
| 38 | + | |
| 39 | - | if not #tArgs == 1 then |
| 39 | + | |
| 40 | - | PrintHelp() |
| 40 | + | |
| 41 | ||
| 42 | local function DigBranch() | |
| 43 | for step = 1, 9 do | |
| 44 | - | if tArgs[ 1 ] > "0" then |
| 44 | + | while turtle.detect() do |
| 45 | - | height = tArgs[ 1 ] |
| 45 | + | turtle.dig() |
| 46 | - | else |
| 46 | + | end |
| 47 | - | PrintHelp() |
| 47 | + | turtle.forward() |
| 48 | while turtle.detectUp() do | |
| 49 | turtle.digUp() | |
| 50 | end | |
| 51 | while not turtle.detectDown() do | |
| 52 | - | -- Start with main shaft. |
| 52 | + | turtle.select( 3 ) |
| 53 | - | for step = height, 128 do |
| 53 | + | turtle.placeDown() |
| 54 | end | |
| 55 | CheckFuel() | |
| 56 | end | |
| 57 | return | |
| 58 | - | turtle.up() |
| 58 | + | |
| 59 | - | if not turtle.detect() then |
| 59 | + | |
| 60 | local function DigTurn() | |
| 61 | while turtle.detect() do | |
| 62 | turtle.dig() | |
| 63 | end | |
| 64 | - | turtle.turnLeft() |
| 64 | + | turtle.forward() |
| 65 | - | if not turtle.detect() then |
| 65 | + | |
| 66 | - | turtle.select( 2 ) |
| 66 | + | turtle.turnLeft() |
| 67 | - | turtle.place() |
| 67 | + | turtle.turnLeft() |
| 68 | PlaceTorch() | |
| 69 | - | for step = height, 128 do |
| 69 | + | turtle.turnLeft() |
| 70 | - | turtle.down() |
| 70 | + | turtle.turnLeft() |
| 71 | - | if not turtle.detect() then |
| 71 | + | |
| 72 | while turtle.detectUp() do | |
| 73 | turtle.digUp() | |
| 74 | end | |
| 75 | while not turtle.detectDown() do | |
| 76 | turtle.select( 3 ) | |
| 77 | turtle.placeDown() | |
| 78 | end | |
| 79 | while turtle.detect() do | |
| 80 | turtle.dig() | |
| 81 | end | |
| 82 | turtle.forward() | |
| 83 | ||
| 84 | while turtle.detectUp() do | |
| 85 | turtle.digUp() | |
| 86 | end | |
| 87 | while not turtle.detectDown() do | |
| 88 | turtle.select( 3 ) | |
| 89 | turtle.placeDown() | |
| 90 | end | |
| 91 | while turtle.detect() do | |
| 92 | turtle.dig() | |
| 93 | end | |
| 94 | turtle.forward() | |
| 95 | while turtle.detectUp() do | |
| 96 | turtle.digUp() | |
| 97 | end | |
| 98 | CheckFuel() | |
| 99 | return | |
| 100 | end | |
| 101 | ||
| 102 | -- Start | |
| 103 | CheckFuel() | |
| 104 | while turtle.getFuelLevel() > 16 and turtle.getItemCount( 1 ) > 1 and turtle.getItemCount( 2 ) > 1 do | |
| 105 | DigBranch() | |
| 106 | turtle.turnLeft() | |
| 107 | DigTurn() | |
| 108 | turtle.turnLeft() | |
| 109 | ||
| 110 | DigBranch() | |
| 111 | turtle.turnRight() | |
| 112 | DigTurn() | |
| 113 | turtle.turnRight() | |
| 114 | end |