SHOW:
|
|
- or go back to the newest paste.
| 1 | near=true | |
| 2 | blocksTravelled = 0 | |
| 3 | ||
| 4 | function detectLava() | |
| 5 | turtle.up() | |
| 6 | - | while turtle.detectUp() do |
| 6 | + | for i=0, 2, 1 do |
| 7 | if not turtle.detectUp() then | |
| 8 | - | end |
| 8 | + | if turtle.digUp() then |
| 9 | - | while turtle.detect() do |
| 9 | + | turtle.placeUp() |
| 10 | end | |
| 11 | - | end |
| 11 | + | end |
| 12 | turtle.turnLeft() | |
| 13 | if not turtle.detect() then | |
| 14 | if turtle.dig() then | |
| 15 | turtle.place() | |
| 16 | end | |
| 17 | end | |
| 18 | turtle.turnRight() | |
| 19 | turtle.turnRight() | |
| 20 | if not turtle.detect() then | |
| 21 | if turtle.dig() then | |
| 22 | turtle.place() | |
| 23 | end | |
| 24 | end | |
| 25 | if i == 0 then | |
| 26 | - | turtle.forward() |
| 26 | + | turtle.down() |
| 27 | end | |
| 28 | end | |
| 29 | - | turtle.turnLeft() |
| 29 | + | |
| 30 | - | for i=0, 16, 1 do |
| 30 | + | |
| 31 | - | turtle.forward() |
| 31 | + | |
| 32 | - | end |
| 32 | + | |
| 33 | - | turtle.turnRight() |
| 33 | + | while turtle.detectUp() do |
| 34 | turtle.digUp() | |
| 35 | end | |
| 36 | while turtle.detect() do | |
| 37 | turtle.dig() | |
| 38 | end | |
| 39 | - | turtle.turnLeft() |
| 39 | + | while not turtle.forward() do |
| 40 | - | for i=0, 16, 1 do |
| 40 | + | |
| 41 | - | turtle.forward() |
| 41 | + | end |
| 42 | - | end |
| 42 | + | detectLava() |
| 43 | - | turtle.turnRight() |
| 43 | + | |
| 44 | end | |
| 45 | ||
| 46 | - | turtle.forward() |
| 46 | + | |
| 47 | if turtle.getItemCount(8) > 0 then | |
| 48 | dropOff() | |
| 49 | end | |
| 50 | end | |
| 51 | ||
| 52 | function dropOff() | |
| 53 | turtle.turnRight() | |
| 54 | - | turn = turtle.turnRight |
| 54 | + | |
| 55 | - | reverseTurn = turtle.turnLeft |
| 55 | + | |
| 56 | turtle.forward() | |
| 57 | - | turn = turtle.turnLeft |
| 57 | + | |
| 58 | - | reverseTurn = turtle.turnRight |
| 58 | + | |
| 59 | turtle.turnLeft() | |
| 60 | for i=0, 16, 1 do | |
| 61 | turtle.forward() | |
| 62 | end | |
| 63 | turtle.turnRight() | |
| 64 | end | |
| 65 | sleep(10) | |
| 66 | turtle.turnRight() | |
| 67 | turtle.turnRight() | |
| 68 | if not near then | |
| 69 | turtle.turnLeft() | |
| 70 | for i=0, 16, 1 do | |
| 71 | - | |
| 71 | + | turtle.forward() |
| 72 | end | |
| 73 | turtle.turnRight() | |
| 74 | end | |
| 75 | for i=0, blocksTravelled - 1, 1 do | |
| 76 | turtle.forward() | |
| 77 | end | |
| 78 | end | |
| 79 | ||
| 80 | function segment(mirror) | |
| 81 | turn = function() error("Turn not being assigned") end
| |
| 82 | reverseTurn = function() error("ReverseTurn not being assigned") end
| |
| 83 | if mirror == true then | |
| 84 | turn = turtle.turnRight | |
| 85 | reverseTurn = turtle.turnLeft | |
| 86 | else | |
| 87 | turn = turtle.turnLeft | |
| 88 | reverseTurn = turtle.turnRight | |
| 89 | end | |
| 90 | turn() | |
| 91 | mine(16) | |
| 92 | near = not near | |
| 93 | turn() | |
| 94 | mine(2) | |
| 95 | reverseTurn() | |
| 96 | reverseTurn() | |
| 97 | mine(5) | |
| 98 | blocksTravelled = blocksTravelled + 3 | |
| 99 | checkInventory() | |
| 100 | end | |
| 101 | ||
| 102 | for i=0, 10, 1 do | |
| 103 | segment(false) | |
| 104 | segment(true) | |
| 105 | end |