SHOW:
|
|
- or go back to the newest paste.
| 1 | local args = {...}
| |
| 2 | ||
| 3 | - | local stripLength = 33 |
| 3 | + | if not #args == 2 then |
| 4 | - | local count = 0 |
| 4 | + | print("Usage: stairs down <current y, desired y>")
|
| 5 | - | local line = 0 |
| 5 | + | |
| 6 | end | |
| 7 | - | if not #args == 1 then |
| 7 | + | |
| 8 | - | print("Usage: smine <mines>")
|
| 8 | + | local curr = tonumber(args[1]) |
| 9 | local goal = tonumber(args[2])+1 | |
| 10 | ||
| 11 | for i=goal,curr do | |
| 12 | - | function strip() |
| 12 | + | while not turtle.forward() do turtle.dig() end |
| 13 | - | count = 0 |
| 13 | + | while not turtle.up() do turtle.digUp() end |
| 14 | - | for i=1,stripLength do |
| 14 | + | |
| 15 | - | count = count + 1 |
| 15 | + | |
| 16 | - | checkFuel(count) |
| 16 | + | |
| 17 | - | checkInv() |
| 17 | + | |
| 18 | - | while not turtle.forward() do turtle.dig() end |
| 18 | + | while not turtle.down() do turtle.digDown() end |
| 19 | while turtle.detectDown() do | |
| 20 | turtle.digDown() | |
| 21 | sleep(0.2) | |
| 22 | end | |
| 23 | turtle.down() | |
| 24 | turtle.digDown() | |
| 25 | turtle.turnRight() | |
| 26 | turtle.turnRight() | |
| 27 | - | |
| 27 | + | |
| 28 | - | if line%8 == 0 then |
| 28 | + | turtle.placeDown() |
| 29 | - | if i%8 == 0 then |
| 29 | + | turtle.turnRight() |
| 30 | - | turtle.select(16) |
| 30 | + | turtle.turnRight() |
| 31 | - | while not turtle.forward() do turtle.dig() end |
| 31 | + | |
| 32 | - | while turtle.detectDown() do |
| 32 | + | |
| 33 | - | turtle.digDown() |
| 33 | + | turtle.turnLeft() |
| 34 | - | sleep(0.2) |
| 34 | + | turtle.turnLeft() |
| 35 | - | end |
| 35 | + | |
| 36 | - | if not turtle.back() then |
| 36 | + | for i=goal,curr do |
| 37 | - | turtle.turnLeft() |
| 37 | + | while not turtle.up() do turtle.digUp() end |
| 38 | - | turtle.turnLeft() |
| 38 | + | while not turtle.forward() do turtle.dig() end |
| 39 | - | while not turtle.forward do turtle.dig() end |
| 39 | + | |
| 40 | - | turtle.turnLeft() |
| 40 | + | |
| 41 | - | turtle.turnLeft() |
| 41 | + | turtle.turnRight() |
| 42 | - | end |
| 42 | + | turtle.turnRight() |