This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
swanjr's profile picture

Stairs, Stairwells, and Tunnel Loop

Started by swanjr, 23 April 2012 - 02:02 AM
swanjr #1
Posted 23 April 2012 - 04:02 AM
Stairs, Stairwells, and Railings

The program below can cut stairs with or without railings and can also dig them as a clockwise stairwell. Try it out and please let me know if you find any bugs.



Features
- Width, height, depth of the stairs can be set.
- Stairs can be cut with or without railings. The width of the railings can be set.
- Stairs will dig a one deep landing area at the end of the stairs for convenience. The width and height of the block are the same as the stairs.
- Stairs can be dug in a clockwise spiral around a central column creating a stairwell. The width of the central column can be set.
- When digging a stairwell, landings will be created for each flight.
- When digging the program will check for falling blocks such as sand and gravel.

Notes
- The turtle will dig through water and lava.
- The turtle will not stop when its inventory is full. You may want to place a single block of any resource you want to keep in the turtle's slots so it is picked up.
- The turtle does not place torches as it goes.
- The turtle does not place stair blocks as it goes. Unfortunately I have been unable to get them to place straight.

Program Instructions
stairs <width> <height> <depth> <railing width> <center column width> ( ex. stairs 3 3 10 1 0 )
- width = how wide the stairs are excluding the railing.
- height = distance from stair to ceiling.
- depth = how deep to dig.
- railing width = how wide the railings should be. The railings are always 1 block high. Zero may be passed in for no railing.
- center column width = if greater than 1, the stairs will spiral around a center column clockwise. This is the width of that column. Zero may be passed in for a straight staircase.

Install Instructions
- Copy the file into 'ComputerCraft/lua/rom/programs/turtle' in your local install or server. Then rename the file to 'stairs' with no suffix.

Change Log
- v1.0 Initial release containing stairs and railings.
- v1.1 Added ability to create stairwells.
- v1.11 Fixed bug where stairwells were dug incorrectly.
- v1.2 The railing has been extended at the bottom of each flight of stairs to be symmetric with the start of each flight of stairs.
- v1.3 Fixed bug for stairswells without railings where the turtle would never dig down. Stairwells with a railing must now have a center column of at least 3.


Tunnel Loop

The program below can cut a tunnel in a clockwise loop. The width, height, and size of the loop can be specified.

Features
- Width, height, and width of the center of the loop can be specified.
- When digging the program will check for falling blocks such as sand and gravel.

Notes
- The turtle will dig through water and lava.
- The turtle will not stop when its inventory is full. You may want to place a single block of any resource you want to keep in the turtle's slots so it is picked up.
- The turtle does not place torches as it goes.

Program Instructions
tunnel_loop <width> <height> <centerWidth> ( ex. tunnel_loop 2 3 10 )
- width = how wide the tunnel is.
- height = distance from floor to ceiling in the tunnel.
- center width = The inner width of the loop (the width of the blocks to leave in the center of the loop).

Install Instructions
- Copy the file into 'ComputerCraft/lua/rom/programs/turtle' in your local install or server. Then rename the file to 'tunnel_loop' with no suffix.

Change Log
- v1.0 Initial release.
swanjr #2
Posted 29 April 2012 - 01:10 AM
Added new tunnel loop program. Handy for underground complex tunnels and clearing out a big area around something.
swanjr #3
Posted 16 May 2012 - 07:59 PM
Stairs program updated to make the bottom and top of a flight of stairs more symmetric.
neto333 #4
Posted 16 May 2012 - 10:07 PM
picture please D:.
D3matt #5
Posted 23 May 2012 - 06:57 PM
The stairs program desperately needs places you can put a torch.

Also, I ran it on a CC1.33 server and let it sit for a half hour running "stairs 5 3 45 1 2" and came back and it just going around the center column, but not actually digging down.
ging3rr #6
Posted 03 June 2012 - 08:26 PM
hello there i used your stairs program i spent the time to put the code in my turtle since i dont have access to the server file i play on but i keep getting string :3: attempting to call nil
any ideas?
thank you for your help
swanjr #7
Posted 15 June 2012 - 04:40 AM
The stairs program desperately needs places you can put a torch.

Also, I ran it on a CC1.33 server and let it sit for a half hour running "stairs 5 3 45 1 2" and came back and it just going around the center column, but not actually digging down.

Yeah, that is a bug. For a stairwell with rails you need to have a center column of at least 3 due to the additional length added by the railings. I have fixed it, however, so a column width of 2 does work for a stairwell without railings. Thanks for letting me know.
swanjr #8
Posted 15 June 2012 - 04:42 AM
hello there i used your stairs program i spent the time to put the code in my turtle since i dont have access to the server file i play on but i keep getting string :3: attempting to call nil
any ideas?
thank you for your help

Unfortunately I do not know why that is not working. I have not tried running the program that way. Sorry.
Klausar #9
Posted 25 June 2012 - 06:15 PM
I got the same problem as ging3rr even though I just copied it into server files
Amunak #10
Posted 26 June 2012 - 11:32 AM
How to make the stairwell? I probably don't understand the arguments.
I used 4 4 60 0 2 and I want stairwell like this:

Top:
████████████
██░░░░░░░░██
██░░████░░██
██░░████░░██
██░░░░░░░░██
████████████
Where
██ = solid block (wall)
░░ = steps

But it did classic straight stairs :/

———————————–

nvm, I got it… I should use:
1 3 60 0 2 :P/>/>

———————————–
But you could also add option for not making the corner steps so big - theres corner like this:

Top:
██░░██
░░░░██
██████
Where
██ = solid block (wall)
░░ = most upper step

But that should be:


Top:
██░░██
▓▓▒▒██
██████
Where
██ = solid block (wall)
░░ = most upper step
▒▒ = middle step
▓▓ = most bottom step

so that the stairs would basically go down much faster.
Kirbychwan #11
Posted 15 November 2012 - 07:19 PM
For the life of me, I cannot get these scripts to function properly when I grab them from pastebin. :P/>/>

Does anyone know what the issue might be? Depending on what numbers I plug into it, the turtle might begin to mine a little, and then freeze up.
Most of the time, it refuses to move at all…

Would really like some help on this, this is probably the only spiral staircase digging program I've seen.
rhyleymaster #12
Posted 15 November 2012 - 07:27 PM
Very nice and handy