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

Circular Structure Builder

Started by CupricWolf, 25 March 2013 - 01:50 PM
CupricWolf #1
Posted 25 March 2013 - 02:50 PM
Hi all. I've modified Pruby's Sphere and Dome Builder program. His original program can be found here. My modifications are as follows: 1) I've added a progress bar that displays the current progress of the program. It does this by first pre-calculating the number of blocks that will be needed as if -c were passed. To do this I had to make the main z-loop into a function and pass whether to count or place blocks. 2) I added the ability for it to build cylinders in addition to the sphere based structures. This is accomplished by writing a new function that is the same as always doing a sphere at radius height. 3) Finally I've added a sphere based structure, the bowl. It is the bottom half of the sphere and was the easiest to implement.

Usage is: cbuild <buildType> <radius> [height] [-c] where buildType is sphere, dome, bowl, or cylinder. If buildType is cylinder then height is used as the height of the cylinder, otherwise height isn't used. If -c is passed the program will only calculate the number of blocks needed and not move or build.

The program is at http://pastebin.com/hLFQVGZq.

I am working on adding the ability to restart after the program being terminated by making a version that saves the number of blocks that were pre-calculated, the number of blocks already placed, the current (x,y,z) coordinate, the facing direction, the radius, the build type, and the height into a file on the computer. When it you run it with the -r option it reads the file and saves the values in the file to variables. Currently I haven't had the time to figure out how to use these values.

If anybody wants to help take a look at the code here http://pastebin.com/1tfQnRKG.

Thanks for reading my word wall I appologize it isn't more pretty but I don't have any photo's on hand.
I hope I'm not intruding too much pruby. I acknowledge that a vast majority of the code it yours. And I thank you for providing the licence that you did. :)/>
CupricWolf #2
Posted 26 March 2013 - 06:58 PM
If anybody reads this, just use Keridos' shape.lua, a project started by Aeolun. I've added the "bowl" shape to it. It is the best shape builder because it is all the shape builders, if you don't see one in it try to add it!