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

xdig - 3x3, 2x2, and 1x2 "tunnel" program

Started by Sir.Mongoose, 05 January 2014 - 09:45 PM
Sir.Mongoose #1
Posted 05 January 2014 - 10:45 PM
"xdig" is a simple and my first REAL program for CC. It has three modes to "tunnel" in 1x2, 2x2, and 3x3. The program lets you pick a mode and tell it how far to tunnel. Along the way it resists to get stuck on things like sand or gravel. It can also place torches every 10 or so blocks, auto refuel itself, an optional automated chest system, and place blocks under it where there is none. I'm not the best at making my code look very clean but it works. I hope you can give it a try and tell me how it can be improved and if you like it! Thanks!

v1.0 (old)
Pastebin
pastebin get BfQ0BBje xdig

v1.1 (old)
Pastebin
pastebin get v681DfPe xdig

Changes:
*Added an optional system to return to chest when inventory has at least 1 block in every slot.

v1.2 New!
Pastebin
pastebin get r73hYcFk xdig

Changes:
*Added a 4x4 vertical mode (y4x4) that has the same functions as the other modes except for placing blocks down. Also It requires a stack of ladders in the fourth slot and will place them on every layer when using y4x4.
Edited on 13 January 2014 - 08:16 PM
gollark8 #2
Posted 06 January 2014 - 03:00 AM
I just checked your code,you need to put the function mode() bit BEFORE the area where it's used.
Sir.Mongoose #3
Posted 07 January 2014 - 09:31 AM
Programed a new chest system. And gollark8 I may make time to fix that and also make my code shorter than 10 kbs.
Edited on 07 January 2014 - 08:58 AM
Jim #4
Posted 10 January 2014 - 07:46 AM
Advice for you!

I see you got all these turtle.select(1) then turtle.drop(64) then all these again selecting one slot per line of code. You can do it much easier.

for i = 3, 16 do
  turtle.select(i)
  turtle.drop()
end

Other than that, really nice work :)/>
Edited on 10 January 2014 - 07:47 AM
Sir.Mongoose #5
Posted 10 January 2014 - 05:30 PM
Thanks, Jim. That will definitely save me some time coding! :)/>

I would also love some suggestions on what to add to this program to make it better. Because I can't come up with any new ideas so far…
Edited on 10 January 2014 - 04:53 PM
Jim #6
Posted 11 January 2014 - 04:10 AM
A little off topic.

Could you go to pastebin and edit then put code highlighting/syntax on 'Lua' ? That would help a bit. Plus the code looks nicer and easier to read.
Edited on 11 January 2014 - 03:11 AM
Sir.Mongoose #7
Posted 13 January 2014 - 09:17 PM
"xdig" has been updated to v1.2. Just a little forum bump.