(Yet Another) Automating Crystallizers - Servo!

Kiada

New Member
Jul 29, 2019
51
0
0
So I had a bit of free time today which I was planning on using to get stuck into learning servo's with the Crystallizer. Googling the topic last night in bed, I noticed Broomstone beat me to it! - but mine is slightly different so I thought I'd post it anyway. Broomstones topic was great for explaining some of the core fundamentals of instruction usage, so thanks a lot :)

I'll be as in-depth as possible, though my way is a little verbose.

The Setup

For reasons I won't go into just yet (saving for later :) ) my ore tripling factory is split up into sections. For the time being my ores are being requested via LP using an OreDict ItemSink module, making sure each ore has it own section (so no need for Parasieves or extra filtering before entering the Crystallizer).

The Servo will fill up every slot on all the Crystallizers in the section with 1 chunk (provided there's enough ore chunks available) before moving onto the next section of Crystallizers. Each "lap" around the factory will add 1 extra chunk to each of the Crystallizers slots. In this proof of concept, I have simply looped my rail back around.

A single Servo for your entire factory.
Each section has 5 x Crystallizers for now, though this is expandable.
1 x Item Shifter for the Servo
1 x Item Shifter for each section of Crystallizers, mounted on the chest containing the ore chunks.

The Item Shifter mounted on the chest pushes chunks of ore from the chest into the Servo when the Servo crosses the Redstone Pulse instruction. You want to set the chest Item Shifters transfer amount to the amount of Crystallizers you are filling up, multiplied by 5 (1 for each slot).

E.g., my sections contain 5 Crystallizers, so the transfer amount is set to maximum 25. Otherwise, you may end up carrying surplus to the next section. This will not happen if you enter the correct transfer amount :)

[Thought: saying that, if every slot on every Crystallizer is full with 64 chunks each (1,600 chunks total per section), this may occur. If you plan on throwing so much ore into a single section, you might want to consider an item shifter instruction between sections that pumps out any excess to ensure your servo is empty after the transition.]

Instructions Required
Set Speed (Optional)
Point Top
Integer
Duplicate
Redstone Pulse
Item Shift Controller
Set Direction
Socket Signal
Sum
Compare
Jump
Drop

Implementation

Please ignore the 'background noise', this was made on a SMP server. You will see lots of machines, fluiducts etc. Concentrate on the servo rails and instructions :)

The start of the loop initializes the Servo for a 'first-time' run - it will never visit this piece of rail again unless it gets removed and needs placing back on the circuit.

The first instruction is 'Set Speed', which sets the speed of the Servo. I generally use 'Slow' for debug and 'Faster' for production. The second instruction is 'Point Top' and serves to rotate your Servo into the correct position. You want your Servos Item Shifter (white pointy device) pointing towards your Crystallizers.

The next instruction is 'Integer' which is set to zero to represent the first slot we will be putting items into. The instruction pushes the integer zero to the top of the stack.

[Stack: 0]

Following 'Integer' is 'Duplicate' and duplicates whatever value is currently on the top of the stack. We do this here because when we hit the 'Item Shifter' instruction next, the value at the top of the stack is popped ('consumed').

[Stack: 0, 0]

xDIVMRk.png


The instruction after 'Duplicate' is the 'Item Shifter' instruction. This instruction alters the options that appear in the GUI when you right-click on your Servos Item Shifter with a Logic Matrix Programmer. Right-clicking on the instruction will cycle through the various options available. We set this instruction to 'Set Target Slot'. This pops the value at the top of the stack and sets it to the Item Shifters target slot. At the moment, 0 is at the top of the stack so the Item Shifter will target slot 0.

[Stack: 0]

'Set Direction' is the next instruction, and will send your Servo whichever way it is pointing. Following that is the 'Redstone Pulse' instruction. Your ore chunks go in the chest mounted behind the Item Shifter, and when the Servo crosses the 'Redstone Pulse' instruction it will receive however many chunks of ore the Item Shifter connected to the chest is configured to output. We use 25 for 5 Crystallizers, though it doesn't matter if there's less than 25 in the chest. Also, set the Item Shifter connected to the chests Transfer Mode to 'Pulse Exact Amount'.

gA9r7Jd.png


The 'Set Direction' instruction we have already used, but the little red dots are 'Socket Signal' instructions and act to transfer items from the Servos inventory to the Crystallizers into whichever slot is currently set in the Servos Item Shifter (via the rail instructions). The rail will head up past the 'Set Direction', and continue all the way across to the left outputting one ore chunk to each Crystallizer. The bottom rail is for the return journey (covered below).

The next few images show the rest of the layout, but it doesn't make sequential sense to explain them separately so the rest is covered underneath.

#1

YLI68qj.png


#2

PlAuQfc.png


#3

RidVXlT.png


So we can pick up where we left off on image #3. After traversing the Crystallizers we hit enough 'Set Direction' which sends us upwards. We duplicate the top of our stack. We do this here because shortly we will use the 'Compare' instruction which will pop and again consume the top two values from the stack. Before the duplicate the only value in our stack was 0, this value is basically our way of counting how many times we have lapped around this section of Crystallizers - so we don't want to lose it to a greedy Compare!

The next sequence of instructions is basically to push the number 4 to the top of the stack. This section is where it's a little bit more verbose and ugly than other solutions seen - but again the end goal is to have all the slots filled with at least one chunk before moving onto the next section (as opposed to putting 1 chunk in every crystallizer per lap around the entire factory).

Why the number 4? Well we want to go around the Crystallizers 5 times and we started our count at 0, so 4 is the magic number :)

So lets look at the sequence...

Integer(1) [Stack: 1,0,0]
Integer(1) [Stack: 1,1,0,0]
Sum [Stack: 2,0,0]
Duplicate [Stack: 2,2,0,0]
Sum [Stack: 4,0,0]

We then hit the 'Compare' instruction. This pops the top two values from the stack, compares them and if they are equal it pushes the boolean value 'true' on to the stack. However until the 5th loop around (when the stack is 4,4,4 here) Compare will always push 'false'.

The Servos preferred direction from this downward movement would be to go left (towards a new section), however we want to keep the Servo in a circuit until we're done with it. So now because the boolean value 'false' is at the top of the stack, the 'Jump' instruction will not run. This sends the Servo to the right using the 'Set Direction' instruction. On the 5th circuit, the 'Jump' instruction tells the Servo to ignore the 'Set Direction' instruction, so the Servo will go left and exit the loop.

However for now we need to increase our counter, change the Item Shifters target slot and go back around.

[Stack: 0]

Integer(1), Sum, Item Shifter.

[Stack: 1]

Rinse and repeat! Hope this helps somebody :)
 
Last edited:
  • Like
Reactions: Broomstone

Broomstone

New Member
Jul 29, 2019
38
0
0
Hurray for servos! I don't have the courage to play with then on survival though. I'm very slow paced so to get all the dark iron would take me quite some time.

Really nice build! Compared to mine it is definetly much faster and precise in distributing chunks!

I do want to ask a few things:

You said the item shifter is set to "extract exact amount" right? That is very nice for precision but did you know it is a little bit picky? if you have less then 25 chunks on the chest the item shifter will not try to put then on the servo,that is because this mode is looking for the exact amount. also this mode will look for its amount in item stacks. For example, if you have two slots on the chest, the first with 8 iron chunks and the second with 26 iron chunks, it will ignore the first one and go for the other. And on the next run, assuming there was no more input into the chest, it will ignore both.

Did you forget you can only take things out of a crystallizer from the bottom? Because I totally did the same thing.

Also which version of factorization you got? there is new stuff in 0.8.33 that can make our builds more compact.
 

Kiada

New Member
Jul 29, 2019
51
0
0
Hey, thanks for taking a look (and your original post!) :) I probably shouldn't be writing any sort of guide to be honest! Only started tinkering with Servos this morning, I never picked up on the extracting exact amounts thing. I guess I need Pulse Some Amount' then? :)

It did occur to me whilst I was writing this how exactly I was going to get the stuff out! I can always play with the arrangement of things I guess as the 'business' end is the (somewhat ugly) tower of instructions to the left, but maybe one (slightly expensive) option might be a chassis pipe with a sneaky and extractor module? Again, definitely needs some polish :) But for now.. must mine more lead o_O
 

Kiada

New Member
Jul 29, 2019
51
0
0
Just caught your last question, I'm playing a DW20 server and it looks like 0.8.28 hrrmm.
 

Broomstone

New Member
Jul 29, 2019
38
0
0
Just caught your last question, I'm playing a DW20 server and it looks like 0.8.28 hrrmm.

Check out the Changelog for Factorization, it is on the download part of the minecraft forum and it has up-to-date information (although short explanations) one thing to note, even if it doesn't matter for this build, is that servos will have only one inventory slot.