SHOW:
|
|
- or go back to the newest paste.
| 1 | function getvar(text) | |
| 2 | term.clear() | |
| 3 | term.setCursorPos(1,1) | |
| 4 | print(text) | |
| 5 | var = read() | |
| 6 | return var | |
| 7 | end | |
| 8 | ||
| 9 | function printpos(text) | |
| 10 | term.clear() | |
| 11 | term.setCursorPos(1,1) | |
| 12 | print(text) | |
| 13 | end | |
| 14 | ||
| 15 | ||
| 16 | function check() | |
| 17 | nope = false | |
| 18 | for i=1,3 do | |
| 19 | turtle.select(i) | |
| 20 | if turtle.compare() then | |
| 21 | nope = true | |
| 22 | end | |
| 23 | if i==3 and nope == false then | |
| 24 | turtle.dig() | |
| 25 | end | |
| 26 | end | |
| 27 | end | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | torch = getvar("use torches? y/n")
| |
| 32 | if torch == "y" then | |
| 33 | everyblocks = tonumber(getvar("place torch every how many blocks?"))
| |
| 34 | - | end |
| 34 | + | |
| 35 | everyblocks = 1 | |
| 36 | end | |
| 37 | looksides = getvar("look for ore on sides? y/n")
| |
| 38 | finish = tonumber(getvar("How far to dig?"))
| |
| 39 | ||
| 40 | pos = 0 | |
| 41 | ||
| 42 | repeat | |
| 43 | for p=1, everyblocks do | |
| 44 | if pos < finish then | |
| 45 | turtle.dig() | |
| 46 | turtle.forward() | |
| 47 | turtle.digDown() | |
| 48 | if looksides == "y" then | |
| 49 | turtle.turnRight() | |
| 50 | check() | |
| 51 | turtle.turnRight() | |
| 52 | turtle.turnRight() | |
| 53 | check() | |
| 54 | turtle.turnRight() | |
| 55 | end | |
| 56 | if p == everyblocks and torch == "y" then | |
| 57 | turtle.select(16) | |
| 58 | turtle.placeDown() | |
| 59 | end | |
| 60 | pos = pos+1 | |
| 61 | end | |
| 62 | end | |
| 63 | until pos >= finish | |
| 64 | turtle.turnRight() | |
| 65 | turtle.turnRight() | |
| 66 | for i=1, finish do | |
| 67 | turtle.forward() | |
| 68 | end | |
| 69 | ||
| 70 | for i=4, 15 do | |
| 71 | turtle.select(i) | |
| 72 | turtle.dropDown() | |
| 73 | end | |
| 74 | turtle.turnLeft() | |
| 75 | for i=1, 3 do | |
| 76 | turtle.dig() | |
| 77 | turtle.forward() | |
| 78 | turtle.digDown() | |
| 79 | end | |
| 80 | turtle.turnLeft() | |
| 81 | os.reboot() |