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]
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'.
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
#2
#3
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
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]
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'.
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
#2
#3
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: