SHOW:
|
|
- or go back to the newest paste.
| 1 | local args = {...}
| |
| 2 | length = args[1] | |
| 3 | ||
| 4 | function dig() | |
| 5 | while turtle.detect() do | |
| 6 | turtle.dig() | |
| 7 | os.sleep(0.5) | |
| 8 | end | |
| 9 | end | |
| 10 | function digUp() | |
| 11 | while turtle.detectUp() do | |
| 12 | turtle.digUp() | |
| 13 | os.sleep(0.5) | |
| 14 | end | |
| 15 | end | |
| 16 | function forward() | |
| 17 | while turtle.forward()==false do | |
| 18 | os.sleep(1) | |
| 19 | dig() | |
| 20 | end | |
| 21 | end | |
| 22 | ||
| 23 | function row() | |
| 24 | digUp() | |
| 25 | turtle.digDown() | |
| 26 | for m=1,4,1 do | |
| 27 | dig() | |
| 28 | forward() | |
| 29 | digUp() | |
| 30 | turtle.digDown() | |
| 31 | end | |
| 32 | end | |
| 33 | ---------------------------- | |
| 34 | function line() | |
| 35 | dig() | |
| 36 | forward() | |
| 37 | turtle.turnRight() | |
| 38 | row() | |
| 39 | turtle.down() | |
| 40 | turtle.digDown() | |
| 41 | turtle.turnRight() | |
| 42 | turtle.turnRight() | |
| 43 | for u=1,4,1 do | |
| 44 | forward() | |
| 45 | turtle.digDown() | |
| 46 | end | |
| 47 | turtle.up() | |
| 48 | turtle.turnRight() | |
| 49 | end | |
| 50 | - | end |
| 50 | + | |
| 51 | function torch() | |
| 52 | turtle.select(1) | |
| 53 | turtle.place() | |
| 54 | end | |
| 55 | ---------------------------- | |
| 56 | function torch2lineEnd() | |
| 57 | dig() | |
| 58 | forward() | |
| 59 | turtle.turnRight() | |
| 60 | row() | |
| 61 | turtle.down() | |
| 62 | turtle.digDown() | |
| 63 | ||
| 64 | dig() | |
| 65 | turtle.down() | |
| 66 | dig() | |
| 67 | ||
| 68 | turtle.turnRight() | |
| 69 | turtle.turnRight() | |
| 70 | dig() | |
| 71 | for u=1,4,1 do | |
| 72 | forward() | |
| 73 | dig() | |
| 74 | end | |
| 75 | turtle.up() | |
| 76 | dig() | |
| 77 | turtle.turnRight() | |
| 78 | ||
| 79 | --2nd line positioning | |
| 80 | dig() | |
| 81 | forward() | |
| 82 | digUp() | |
| 83 | turtle.up() | |
| 84 | ||
| 85 | turtle.turnRight() | |
| 86 | turtle.turnRight() | |
| 87 | torch() | |
| 88 | ||
| 89 | --2nd line | |
| 90 | turtle.turnLeft() | |
| 91 | row() | |
| 92 | ||
| 93 | turtle.turnRight() | |
| 94 | torch() | |
| 95 | turtle.turnRight() | |
| 96 | ||
| 97 | turtle.down() | |
| 98 | turtle.digDown() | |
| 99 | for u=1,4,1 do | |
| 100 | forward() | |
| 101 | turtle.digDown() | |
| 102 | end | |
| 103 | turtle.up() | |
| 104 | turtle.turnRight() | |
| 105 | end | |
| 106 | ---------------------------- | |
| 107 | function torch2line() | |
| 108 | dig() | |
| 109 | forward() | |
| 110 | turtle.turnRight() | |
| 111 | row() | |
| 112 | turtle.down() | |
| 113 | turtle.digDown() | |
| 114 | ||
| 115 | torch() | |
| 116 | ||
| 117 | turtle.turnRight() | |
| 118 | turtle.turnRight() | |
| 119 | ||
| 120 | for u=1,4,1 do | |
| 121 | forward() | |
| 122 | turtle.digDown() | |
| 123 | end | |
| 124 | ||
| 125 | torch() | |
| 126 | turtle.turnRight() | |
| 127 | ||
| 128 | --2nd line positioning | |
| 129 | dig() | |
| 130 | forward() | |
| 131 | digUp() | |
| 132 | turtle.up() | |
| 133 | ||
| 134 | turtle.turnRight() | |
| 135 | turtle.turnRight() | |
| 136 | torch() | |
| 137 | ||
| 138 | --2nd line | |
| 139 | turtle.turnLeft() | |
| 140 | row() | |
| 141 | ||
| 142 | turtle.turnRight() | |
| 143 | torch() | |
| 144 | turtle.turnRight() | |
| 145 | ||
| 146 | turtle.down() | |
| 147 | turtle.digDown() | |
| 148 | for u=1,4,1 do | |
| 149 | forward() | |
| 150 | turtle.digDown() | |
| 151 | end | |
| 152 | turtle.up() | |
| 153 | turtle.turnRight() | |
| 154 | end | |
| 155 | ---------------------------- | |
| 156 | turtle.up() | |
| 157 | turtle.up() | |
| 158 | for i=1,length,1 do | |
| 159 | line() | |
| 160 | line() | |
| 161 | torch2line() | |
| 162 | line() | |
| 163 | torch2line() | |
| 164 | line() | |
| 165 | line() | |
| 166 | torch2lineEnd() | |
| 167 | end | |
| 168 | turtle.down() | |
| 169 | turtle.down() |