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

BigReactors Gelid Cryotheum Filler [v1.0]

Started by günthi57, 04 September 2015 - 04:00 PM
günthi57 #1
Posted 04 September 2015 - 06:00 PM
Hello everyone!

I've been messing around with ComputerCraft in the last days and wrote some useful programs for my SkyFactory 2 server.
My buddy alway hated to fill his huge reactors with Cryotheum, since this fluid flows downwards once you've placed it and you'll have to place a bucket for every single block you want to fill with the liquid, which gets quite annoying over time.

So I wrote a program that allows your turtle to do that work for you. I first wanted to do that with vanilla bucket, but I soon figured out that that wouldn't work (the turtle would just ignore the bucket and do nothing). So I tested it with Ender Utilities' Ender Bucket and it worked!

Here is, what the program finally does:

- First, the turtle figures out the height of the reactor by its own.
- It starts filling up the reactor by placing a bucket every 2 seconds so that the fluid has time to move down.
- If the bucket is empty, the turtle places a tank (e.g. a drum), refills the Ender Bucket and destroys the tank again.
- After fully filling a 1x1 space the turtle places Reactor Glass.

- The turtle finally stops, when it has fully filled the reactor!

How to use the program:
Spoiler- Place the turtle on top of the reactor in the left corner (like shown in the picture)


- In slot one you put a fully filled Ender Bucket.
- In slot 16 you put your tank (I suggest to use a bedrockium drum)
- In slot 15 you put Reactor Casing, so that the turtle can compare it to the ground and decide when it has to change the direction.
- In slots 9,10,11,13 and 14 you put Reactor Casing (not all slots have to be filled, but make sure you have at least 16 Glass in slot 14)


-> run the program!

Here is the code! Feel free to edit and improve it, since I am a beginner ;D
Spoiler

bucketCount = 16
height = 0
dir = 1
function refillBucket()
turtle.select(16)
	turtle.placeUp()
	turtle.select(1)
	for i = 1,16 do
	 turtle.placeUp()
	end
	turtle.select(16)
	turtle.digUp()
	bucketCount = 16
  
  
	 turtle.select(8)
	turtle.transferTo(12,1)
	 turtle.select(12)
	turtle.transferTo(16,1)
  
  
	 turtle.select(9)
	turtle.transferTo(10,64)
	 turtle.select(10)
	turtle.transferTo(11,64)
	turtle.select(11)
	turtle.transferTo(13,64)
	turtle.select(13)
	turtle.transferTo(14,64)
end
function placeBucket()
if bucketCount == 0 then
	 refillBucket()
	end
	bucketCount = bucketCount - 1
turtle.select(1)
turtle.placeDown()
	sleep(2)
end
function fforward()
while turtle.forward()==false do
end
end

function right()
turtle.turnRight()
end
function left()
turtle.turnLeft()
end
turtle.select(15)
if turtle.compareDown()==false then
print("Wrong place! Place Turtle in the left corner! Put Reactor Casing in the 15th slot!")
else
fforward()
right()
fforward()
left()
while turtle.detectDown()==false do
turtle.down()
	height = height + 1
end
for i = 1,(height) do
turtle.up()
end
finished = false
while finished==false do

	for i = 1,(height - 1) do
	 placeBucket()
	  
	end
	turtle.select(14)
		turtle.placeDown()
	fforward()
	while turtle.detectDown() do
	 turtle.select(15)
	 if turtle.compareDown() then
		
		 if dir == 1 then
			 right()
				fforward()
				right()
				fforward()
				if turtle.compareDown() then
				 finished = true
				end
				dir = 2
			
			else
			 left()
				fforward()
				left()
				fforward()
				if turtle.compareDown() then
				 finished = true
				end
				dir = 1
			
			end
		else
		fforward()
		end
	end
end
end
And the pastebin link: http://pastebin.com/SbnAAVeQ


I hope I didn't forget anything :D/> I am open to critics and I hope some of you are going to use this program, since it is really helpful in End-Game when you're about to build huge reactors and want them to be very efficient but you are to lacy to fill the reactor with Gelid Cryotheum by yourself :D/>

Have a nice day,
guenthi57
negamartin #2
Posted 14 September 2015 - 02:56 PM
I havent tested this program, and I will probably not do it, because I dont use BigReactors :P/>
But I can atleast guess some things.
Did you actually test vanilla buckets?
Because using turtle.place() they work with water and lava, atleast. Also, you can use turtle.inspect() to check for block names, so you dont have to put a Reactor Casing in slot 15.
And if I ever start using BigReactors, I will probably remember this post, and save me from the work of coding or manually filling my reactors :P/>