Jump to content




[Program] Advanced tunneler


30 replies to this topic

#1 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 12:53 AM

Hi everybody !

Here is a big program I've made.
First, it was to train myself using ComputerCraft but I expanded it a lot and, I think, it can be very usefull so I share it !

I'll post more screenshots later but you already can see what it does !

On the following picture, you can see the default program (without any config, it does a 3x3x10 tunnel and fills all walls. It also come back to start when it needs to empty itself and when it need more filling blocks.
If you want it to empty itself, you have to put a chest behind its start position.

Screenshots :
Spoiler

Current options are :

- Tunnel width : Tunnel width !
- Tunnel height : Tunnel height !
- Tunnel length : Tunnel length !

- Run in dig only mode ? : If 'y', it won't care about walls, ceiling and floor. It'll only dig !
--> Fill left wall ? : If 'y', it will put blocks on the left wall.
--> Fill right wall ? : Same but right wall
--> Fill back wall ? : Same but back wall
--> Fill ceiling ? : Same but ceiling
--> Fill floor ? : Same but floor
--> Go back when I need filling blocks ? If there are less than 5 filling blocks, must it go back to start and wait for you to give it more blocks ?
--> How many slots must I keep for filling blocks ? : It will try (as possible) to keep that number of slots for filling blocks. (Example, if you put cobble and it digs cobble, it will be able to re-use it. Moreover, if it is full of cobble and you put 4 slots to keep, it will empty the 12 in the chest.

- Should I empty myself when I'm full ? : If 'y', the turtle will go back to start and empty itself in the chest. (Chest must be behind it at launching !)
- Should I send infos on rednet ? : If 'y', turtle will send these messages "Need empty", "Empty done", "Need block", "Going back to work", "Launching" and "Done".

("-->" Means dependancy : If you say "Dig only", it won't ask you everything)

If you look at the turtle screen while it is running, you can also see a progress bar to tell you about its... Progress !

I did it in 3 days so sorry if it need more options. If you have any idea of improvement, tell me ! I'll do it as quick as possible ! ;)/>

TODO list :
Spoiler

Links :
Spoiler

I hope it will be usefull !
(By the way, if you find any bug, tell me !)

Edit :

---------------------------------
Added in TODO list :

- Place torches !!!!
- Refuel itself.
---------------------------------
More screenshots !!
---------------------------------

Edited by Ninetainedo, 25 August 2015 - 06:18 PM.


#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 April 2013 - 12:58 AM

Looks good :)

I think the ability to place torches would be nice :)

#3 Aptik

  • Members
  • 32 posts
  • LocationUkraine

Posted 05 April 2013 - 01:19 AM

Why there are no turtle.refuel in your program?

#4 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 01:27 AM

View Posttheoriginalbit, on 05 April 2013 - 12:58 AM, said:

Looks good :)

I think the ability to place torches would be nice :)

Thanks ! I forgot it !


View PostAptik, on 05 April 2013 - 01:19 AM, said:

Why there are no turtle.refuel in your program?

Because I don't use fuel on my server. But I think it would be usefull to add this feature so thank you, I wrote it in my TODO list ! ;)

If there are other ideas, tell me ! :)
And thanks for your feedback !

#5 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 01:44 AM

v2.1 : http://pastebin.com/At8WF41E
- Fixed bug when dig only. It tried to find blocks
- Fixed message "Fill walls ?" -> "Dig only ?"

Added screenshot:

Spoiler
(You also can build bridges if you only fill the floor !)

#6 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 05 April 2013 - 09:48 AM

Make the config say true or false instead of y and n

#7 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 10:13 AM

View PostEngineer, on 05 April 2013 - 09:48 AM, said:

Make the config say true or false instead of y and n

Why should I do so ? You think it is more explicite ?

#8 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 05 April 2013 - 10:17 AM

View PostNinetainedo, on 05 April 2013 - 10:13 AM, said:

View PostEngineer, on 05 April 2013 - 09:48 AM, said:

Make the config say true or false instead of y and n

Why should I do so ? You think it is more explicite ?
It makes more sense

#9 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 10:57 AM

View PostEngineer, on 05 April 2013 - 10:17 AM, said:

View PostNinetainedo, on 05 April 2013 - 10:13 AM, said:

View PostEngineer, on 05 April 2013 - 09:48 AM, said:

Make the config say true or false instead of y and n
Why should I do so ? You think it is more explicite ?
It makes more sense

It makes more sense for a coder but I think it is not the case for a random user.

#10 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 05 April 2013 - 11:07 AM

View PostNinetainedo, on 05 April 2013 - 10:57 AM, said:

View PostEngineer, on 05 April 2013 - 10:17 AM, said:

View PostNinetainedo, on 05 April 2013 - 10:13 AM, said:

View PostEngineer, on 05 April 2013 - 09:48 AM, said:

Make the config say true or false instead of y and n
Why should I do so ? You think it is more explicite ?
It makes more sense

It makes more sense for a coder but I think it is not the case for a random user.

Well lets say somebody just wants the code and didnt read the thread. I know you should read it, but hey, those people exist!
For those, 'y' makes no sense. Because they dont know what it means, they can guess but that is not reliable.

If it is the keyword true or false, almost everyone knows it. Just look at configs files of mods. They use 0 or 1, or true and false.
For the 0 and 1 part, it is binary that makes also sense if you know that.

But since its such a minor change, I am not going to even worry about it anymore.

#11 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 11:25 AM

Are you talking about my example screenshot ?
I see what you mean !
I put 'y' and 'n' because, during config mode, my programs asks like this:

"Should I go back to start when I need filling blocks ? (y/n) "
It is a question directly asked to the user.

The screenshot shows the "recap" step. It's when the programs wants the user to confirm all is good. Do you see what I mean ?

#12 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 05 April 2013 - 11:47 AM

View PostNinetainedo, on 05 April 2013 - 11:25 AM, said:

Are you talking about my example screenshot ?
I see what you mean !
I put 'y' and 'n' because, during config mode, my programs asks like this:

"Should I go back to start when I need filling blocks ? (y/n) "
It is a question directly asked to the user.

The screenshot shows the "recap" step. It's when the programs wants the user to confirm all is good. Do you see what I mean ?
Wow, I really need to give myself a facepalm. Im sorry, I take back all my words I've said.
I would edit it out, but it is a little awkward to say at every post: edited out.

And Its a good program, dont get me wrong here :)

#13 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 April 2013 - 12:02 PM

View PostEngineer, on 05 April 2013 - 11:47 AM, said:

View PostNinetainedo, on 05 April 2013 - 11:25 AM, said:

Are you talking about my example screenshot ? I see what you mean ! I put 'y' and 'n' because, during config mode, my programs asks like this: "Should I go back to start when I need filling blocks ? (y/n) " It is a question directly asked to the user. The screenshot shows the "recap" step. It's when the programs wants the user to confirm all is good. Do you see what I mean ?
Wow, I really need to give myself a facepalm. Im sorry, I take back all my words I've said. I would edit it out, but it is a little awkward to say at every post: edited out. And Its a good program, dont get me wrong here :)/>

Ok it's fine !
I now know my screen is a bit confusing ! ;)

#14 Aptik

  • Members
  • 32 posts
  • LocationUkraine

Posted 05 April 2013 - 08:29 PM

What about resume building after server restart/chunk load?

#15 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 06 April 2013 - 01:09 AM

View PostAptik, on 05 April 2013 - 08:29 PM, said:

What about resume building after server restart/chunk load?

I think such a feature would need me to change a huge part of code because I didn't think it to work this way. =/

#16 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 08 April 2013 - 06:58 AM

Hum... What would you think about a "Fill holes" mode ?
Instead of filling each wall with the defined block, it will only fill holes ! (I think it will also fill lava/water)

#17 keegras

  • New Members
  • 1 posts

Posted 11 April 2013 - 01:37 AM

I really like the program and used it quite a bit yesterday. There's a bug in it though, and that's when it comes to mining and there's gravel dropping infront of it. It will just stay immobilized until I go there and manually remove the gravel with a shovel. After that the turtle will go on with the digging. Same goes for when you use the option to fill the walls/ceiling if there's some gravel above the last block in walls/ceilings. It destroys the top/sides last block, and if gravel then drops in from above, it can't place the wall blocks and it will be stuck there until I manually remove the gravel.

This bug prevents the option to let the program run and come back later, as you need to supervise it incase of gravel drops. I guess sand or any other falling block will create the same problem, but I have not tested it.


Other suggested improvements:

- The possibility to enter a negative height number (or option) for the turtle to dig down instead of only up. (And stopping/returning incase bedrock has been reached)

- When the turtle is done with the job and returns to the initial starting position with the chest, it does not empty itself. It only emties itself when it's full at the moment.

- A "fill holes only" mode woud be nice

- Keegras

#18 Ryusho

  • Members
  • 7 posts

Posted 05 July 2013 - 09:49 AM

I have seen the bug mentioned in the previous post, and I know this is a older thread, but I actually am looking to try to see if I can figure out a simple way to set a detect and dig untill block is indeed clear then place the new block setup for incase that happens, even though I have minimal Turtle programing experience, I can understand how it works, I just need to figure out the loops he has done and figure out a fix.


Well I mean, I know the basic logic to probably fix it.. I just need...to try to wrap my head around where I need to place it, ..I noticed his comment lines are in french and that...doesn't help me much since I am only an english speaker, at least I assume the comment lines are in french....*also asks a pro*

#19 Telokis

  • Members
  • 88 posts
  • LocationToulouse, France

Posted 05 July 2013 - 11:37 AM

Hi,

here is another version.
I discovered several bugs so I modified them.

http://pastebin.com/H6KhC9Wn

Sorry if I don't speak a lot, I have a lot of work to do. (In Real Life)

#20 Ryusho

  • Members
  • 7 posts

Posted 05 July 2013 - 02:57 PM

View PostNinetainedo, on 05 July 2013 - 11:37 AM, said:

Hi,

here is another version.
I discovered several bugs so I modified them.

http://pastebin.com/H6KhC9Wn

Sorry if I don't speak a lot, I have a lot of work to do. (In Real Life)

Alright, Well, i see the wall gravel bug is still there, so I am going to have my friend look it over when he gets home, and when it is, I will add the repaired wall--ggravel bug that there is, as it is the current major issue for my own personal use.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users