SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- ################## |
| 1 | + | -- # Torches = 16 # |
| 2 | - | -- # Torches, Chest # |
| 2 | + | -- # Empty = 15 # |
| 3 | - | -- ################## |
| 3 | + | |
| 4 | - | -- # Torches = 15 # |
| 4 | + | |
| 5 | - | -- # Chest = 14 # |
| 5 | + | |
| 6 | - | -- ################## |
| 6 | + | |
| 7 | ||
| 8 | - | print("Starting branch-program")
|
| 8 | + | |
| 9 | ||
| 10 | if ( message == "start" ) then | |
| 11 | print("How many rows?")
| |
| 12 | message = io.read() | |
| 13 | ||
| 14 | rows = tonumber( message ) | |
| 15 | end | |
| 16 | ||
| 17 | if ( rows ~= 0 ) then | |
| 18 | -- # Branches # | |
| 19 | for z=1, rows do | |
| 20 | -- # Dig this branch # | |
| 21 | for x=1, 40 do | |
| 22 | turtle.dig() | |
| 23 | turtle.forward() | |
| 24 | turtle.digUp() | |
| 25 | end | |
| 26 | ||
| 27 | -- # Full inventory # | |
| 28 | if turtle.getItemCount( 15 ) > 0 then | |
| 29 | shell.run("shutdown")
| |
| 30 | end | |
| 31 | ||
| 32 | -- # Return, placing torches # | |
| 33 | turtle.select(16) | |
| 34 | ||
| 35 | - | if turtle.getItemCount( 14 ) > 0 then |
| 35 | + | |
| 36 | - | turtle.select(16) |
| 36 | + | |
| 37 | - | turtle.place() |
| 37 | + | |
| 38 | - | |
| 38 | + | |
| 39 | - | for i=1, 14 do |
| 39 | + | |
| 40 | - | turtle.select( i ) |
| 40 | + | |
| 41 | - | turtle.drop() |
| 41 | + | |
| 42 | ||
| 43 | -- # Starting a new row # | |
| 44 | turtle.turnLeft() | |
| 45 | turtle.dig() | |
| 46 | turtle.forward() | |
| 47 | turtle.digUp() | |
| 48 | - | turtle.select(15) |
| 48 | + | |
| 49 | turtle.forward() | |
| 50 | - | for i=1, 40 do |
| 50 | + | |
| 51 | turtle.dig() | |
| 52 | turtle.forward() | |
| 53 | turtle.turnRight() | |
| 54 | end | |
| 55 | end |