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

Simple Excavation program

Started by Zeizon, 06 October 2012 - 09:41 AM
Zeizon #1
Posted 06 October 2012 - 11:41 AM
Hi,

First time posting.

This is simple excavation program that i designed to dig out chunk sized areas, but it can be used to dig out any sized area.
I spend about 4 days learning lua, but in this time i did rewrite code couple of times.

I would have used that excavate program and modified that, but couldn't find it anywhere.

Basicly this just excavates prederminated area and between every layer it will come to starting point and redstone signal backside for RP2 filter dropoff

Code:
http://pastebin.com/s6VfnVrM

Hope it's ok that function names are in finnish. I commented most of the functionality.

Ps.
Computercraft is really good tool to learn programming!
felippeth #2
Posted 09 November 2012 - 01:40 AM
Cool program. I'm going to try it later. It would be awesome if you could rename the functions tho. Don't know if you named them in the first place but it is good practice to code in english. That way it's easier for others to understand, help and make sense of the code. :P/>/>
slay_mithos #3
Posted 09 November 2012 - 02:09 AM
I'll tell you what I have been told on my first try at this too.
Please add "local" before all "function" that you don't intend to call from an other program, it really does help with memory.

Also, for the check inventory, you could just check if there is any item in the slot 16 (last one), it's an easy way to do that.