Posted 07 August 2013 - 12:29 PM
Hello computercraft forums! I have very recently gotten into programming and turtles have turned out to be the most fun way to learn I've ever found. After two (very) late nights I have finally written a working and well-featured branch mining program.
I'm sure that this forum is positively inundated with posts almost exactly like this one, but I would really appreciate some folks looking over this and offering suggestions. I did as much as I could without looking at other programs to see how they did it, and instead tried to figure it out just looking at the turtle API and the LUA manual.
The program will cause the turtle to dig a central shaft with the number of brances, length of branches, and distance between them specified by the user. It places torches before and at the end of each branch and will return home when its inventory is full to dump it all into a chest (placed behind the turtle at startup). It calculates the fuel cost at the beginning and ensures that it has enough to complete the whole job (this seems more efficient to me than refueling on the go or using fuel to come get more fuel… also it was easier).
Anyway, to the pastebin!
http://pastebin.com/sRzC6NEf
Any thoughts or critiques would be greatly appreciated.
I'm sure that this forum is positively inundated with posts almost exactly like this one, but I would really appreciate some folks looking over this and offering suggestions. I did as much as I could without looking at other programs to see how they did it, and instead tried to figure it out just looking at the turtle API and the LUA manual.
The program will cause the turtle to dig a central shaft with the number of brances, length of branches, and distance between them specified by the user. It places torches before and at the end of each branch and will return home when its inventory is full to dump it all into a chest (placed behind the turtle at startup). It calculates the fuel cost at the beginning and ensures that it has enough to complete the whole job (this seems more efficient to me than refueling on the go or using fuel to come get more fuel… also it was easier).
Anyway, to the pastebin!
http://pastebin.com/sRzC6NEf
Any thoughts or critiques would be greatly appreciated.