SHOW:
|
|
- or go back to the newest paste.
| 1 | - | print(" _______ ")
|
| 1 | + | print(" IPJ's \u221e Quarry")
|
| 2 | - | print(" .'_/_|_\_'. ")
|
| 2 | + | |
| 3 | - | print(" \'\ | /'/")
|
| 3 | + | |
| 4 | - | print(" '\\ | //'")
|
| 4 | + | |
| 5 | - | print(" IPJ `\|/` Quarry")
|
| 5 | + | |
| 6 | tArgs = { ... }
| |
| 7 | ||
| 8 | local x = tonumber(tArgs[1] or "") | |
| 9 | while not x do | |
| 10 | print("Need a distance to travel in number form")
| |
| 11 | x = tonumber(read()) | |
| 12 | end | |
| 13 | ||
| 14 | ||
| 15 | local y = tonumber(tArgs[1] or "") | |
| 16 | while not y do | |
| 17 | print ("I need your y coord")
| |
| 18 | y = tonumber(read()) | |
| 19 | end | |
| 20 | ||
| 21 | y = y - 5 | |
| 22 | ||
| 23 | function drop() | |
| 24 | if turtle.getItemCount(16) > 0 then | |
| 25 | turtle.select(1) | |
| 26 | turtle.digDown() | |
| 27 | turtle.placeDown() | |
| 28 | for i=1,16 do | |
| 29 | turtle.select(i) | |
| 30 | turtle.dropDown() | |
| 31 | end | |
| 32 | turtle.select(1) | |
| 33 | turtle.digDown() | |
| 34 | end | |
| 35 | end | |
| 36 | ||
| 37 | function go() | |
| 38 | while not turtle.forward() do | |
| 39 | turtle.attack() | |
| 40 | turtle.dig() | |
| 41 | end | |
| 42 | sleep(0.8) | |
| 43 | end | |
| 44 | ||
| 45 | function dig() | |
| 46 | turtle.digUp() | |
| 47 | sleep(0) | |
| 48 | turtle.dig() | |
| 49 | turtle.digDown() | |
| 50 | drop() | |
| 51 | end | |
| 52 | ||
| 53 | function move() | |
| 54 | sleep(0) | |
| 55 | dig() | |
| 56 | go() | |
| 57 | end | |
| 58 | ||
| 59 | function row() | |
| 60 | for i=1,x do | |
| 61 | sleep(0) | |
| 62 | move() | |
| 63 | end | |
| 64 | end | |
| 65 | ||
| 66 | function row1() | |
| 67 | turtle.turnRight() | |
| 68 | move() | |
| 69 | turtle.turnRight() | |
| 70 | end | |
| 71 | ||
| 72 | function row2() | |
| 73 | turtle.turnLeft() | |
| 74 | move() | |
| 75 | turtle.turnLeft() | |
| 76 | end | |
| 77 | ||
| 78 | function all() | |
| 79 | for i=1,x do | |
| 80 | row() | |
| 81 | row1() | |
| 82 | row() | |
| 83 | row2() | |
| 84 | end | |
| 85 | end | |
| 86 | ||
| 87 | function home() | |
| 88 | turtle.turnLeft() | |
| 89 | for i=1,x do | |
| 90 | sleep(0) | |
| 91 | go() | |
| 92 | go() | |
| 93 | end | |
| 94 | turtle.turnRight() | |
| 95 | for i=1,3 do | |
| 96 | turtle.up() | |
| 97 | turtle.digUp() | |
| 98 | sleep(0) | |
| 99 | end | |
| 100 | end | |
| 101 | ||
| 102 | for i=1,y do | |
| 103 | all() | |
| 104 | home() | |
| 105 | end |