I'm new here in the forum as well as in the Arduino world. i've atomized a production table that I've made to assemble my product (my own invention). i just can't figure it out with the coding.
I used the parts of my geetech 3d printer. especially the stepper motors 2 x bipolar
driver for this one I have tried with L298N but it was soon clear that it was heavy had no idea if the stepper motors pull more than 2A. I have ordered new ones this time TB6600.
Below I have a video link where I explain how I want it to work.
Your video illustrates your equipment and process very nicely.
If you are new to programming this will be a fairly complex project with a steep learning curve.
Also it seems that there are several elements of the machine control system that you have not yet made decisions about - the sensors that would let the Arduino know where things are.
You say " i just can't figure it out with the coding." but you have not told us if you have any working code. For example have you a short program that can make a stepper motor move back and forth.
With regard to position sensing ... if all the black blocks are the same length and if they are always touching each other (being pushed) then maybe all that is needed is a sensor that detects the home (or zero) position for the pusher stepper motor. It may be possible to infer everything by keeping count of the motor steps.
It may be desirable to have another sensor to prevent glue being discharged is there is no block under the glue nozzle.
A complex program like this should be created from several separate parts. Develop and test each part separately before beginning to join them together. The different parts will probably include
moving a stepper motor,
moving the motor to the home position,
detecting the presence of a block with a sensor (an IR beam-break sensor should work - a reflective sensor would probably be easier to install but may not work well with the black plastic.