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

LavaLake 1.0 - Use lava as your fuel!

Started by marceloclp, 30 April 2014 - 05:46 AM
marceloclp #1
Posted 30 April 2014 - 07:46 AM
Lava Lake v1

by marceloclp


This program focus on clearing lava lakes, and using them as fuel for your turtles. It can be used as a simple lava lake cleaner, or as a super efficient refuel program. This script was first designed to be used as a pre-quarry, or any high-cost energy program, where the turtles would need an unreal amount of energy (somewhat nearby 140.000).

The program may take a while to finish, depending on the size of the lake.

Features
  • It's as simple as possible. Doesn't take a single argument.
  • Can easily get over 300.000 energy on a single lake (depending of the size).
  • Smart AI: it'll go over every single possible block of lava, and come back to the starting position.
What can't do
  • It still needs some work on the "coming back" AI. If it finds a block in the way back, it'll get stuck. Try not to grind lakes where it has "mountains" that go above the lake itself.
  • It can't fully grind lakes that randomly get smaller and bigger again. I would have to basically double the time in order to do it. It's just not worth it, just grind it as two different lakes.
Planned features for v2
  • Improvements on the "coming back" AI and user interface.
How to use:
  1. Go to a place where you can easily find lava lakes, like the nether.
  2. Place your turtle one block above the level of the lava, in one of the extremities (check image for a better understanding).
    Spoiler
  3. Place a bucket on the first slot and execute the program. Don't forget to label your turtle, otherwise you will lose all the energy.


This is my first successful program. Any ideas you may have to improve it, feel free to post.

Link: http://pastebin.com/53iWYQ7W
Edited on 30 April 2014 - 06:25 PM
Lyqyd #2
Posted 30 April 2014 - 03:29 PM
Please report your topic when you have code to post and we will unlock it.

Locked.

Unlocked so code may be posted.
Blue #3
Posted 01 May 2014 - 02:28 PM
nice! :)/> though when i looked at the title i was hoping to have a lava lake creator :(hope that you're going to add this!
marceloclp #4
Posted 01 May 2014 - 08:10 PM
nice! :)/> though when i looked at the title i was hoping to have a lava lake creator :(hope that you're going to add this!
That would be a real challenge to do, in fact. But the shape of the lake would have to be done by hand, I don't see a way to automate this. The only part that could be automated (from my POV) is the lava placing. And still, it would require the user to fill the lava buckets, if playing in vanilla + CC.
Ion Silverbolt #5
Posted 17 May 2014 - 04:42 PM
I love how simple and effective your program is. It doesn't always get all the lava, but it gets most, if not all of a lava lake a lot faster than my version of this program.


My version has two modes:

The first mode scans the perimeter to get the area of the lava lake, then sweeps the area completely clean of lava. This gets ALL of the lava completely, even lava that is covered by rock. The downside to this is it's more destructive. It will clear blocks to ensure it scans the whole area. Using scan in a diagonal lava trench can also make the program cover a lot of unnecessary area. Still, it works really well for standard lakes.

The second mode(default) lets you specify a length and width, thereby bypassing perimeter scanning entirely. This option is much quicker, and works just as well if you know the area you want to clear. This is also useful for carving paths through giant nether lakes. :)/>
aoi222 #6
Posted 22 May 2014 - 04:06 AM
Awesome idea. You inspired me to create my own version with slightly different logic. My version uses a depth first search algorithm to follow continuous paths of lava up to a certain distance away from the starting point. It also uses two buckets to only follow paths where it finds lava.

It's not quite as efficient as yours in terms of movement, but it handles odd shapes better. Only issue seems to be a bug that allows the turtle to pick up liquids from two blocks away, which throws off the algorithm a bit.

If anyone is interested, the code is here: http://pastebin.com/jQd0D3VC