SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- This program digs a 5 x 5 stairwell |
| 1 | + | -- This program digs a 5 x 5 stairwell down to bedrock |
| 2 | - | -- down to bedrock |
| 2 | + | |
| 3 | -- Functions | |
| 4 | - | function cut(blocks) |
| 4 | + | function cut(blocks) -- this function is used to cut the initial run of five steps |
| 5 | for z = 1, blocks do | |
| 6 | - | turtle.dig() |
| 6 | + | turtle.dig() |
| 7 | - | turtle.forward() |
| 7 | + | turtle.forward() |
| 8 | end | |
| 9 | end | |
| 10 | - | |
| 10 | + | |
| 11 | function cutStep() -- this function cuts a 4 block high step | |
| 12 | for y = 1, (size - 1) do | |
| 13 | - | for a = 1, size do |
| 13 | + | turtle.dig() |
| 14 | turtle.forward() | |
| 15 | turtle.digDown() | |
| 16 | turtle.digUp() | |
| 17 | - | if (size - (a + 1)) > 0 then |
| 17 | + | turtle.up() |
| 18 | turtle.digUp() | |
| 19 | - | turtle.back() |
| 19 | + | turtle.down() |
| 20 | turtle.down() | |
| 21 | end | |
| 22 | end | |
| 23 | ||
| 24 | - | turtle.turnRight() |
| 24 | + | -- Main program control section |
| 25 | ||
| 26 | - | for c = 1, (size - 1) do |
| 26 | + | |
| 27 | - | turtle.dig() |
| 27 | + | for a = 1, size do -- Cut the initial steps |
| 28 | - | turtle.forward() |
| 28 | + | |
| 29 | - | turtle.digUp() |
| 29 | + | |
| 30 | - | turtle.up() |
| 30 | + | |
| 31 | - | turtle.digUp() |
| 31 | + | if (size - (a + 1)) > 0 then |
| 32 | - | turtle.down() |
| 32 | + | |
| 33 | - | turtle.digDown() |
| 33 | + | turtle.back() |
| 34 | - | turtle.down() |
| 34 | + | |
| 35 | - | turtle.digDown() |
| 35 | + | |
| 36 | - | turtle.down() |
| 36 | + | |
| 37 | - | end |
| 37 | + | |
| 38 | for c = 2, 17 do -- Cut subsequent courses of steps | |
| 39 | turtle.turnRight() | |
| 40 | cutStep() | |
| 41 | end |