I mostly just made this for automating my petal apothecary but i made it nice and abstract so it can be used for any recipes that require ingredients to be input in sequence.
I was just going to use it myself but after 3 hours of debugging I thought I need to at least share this to make it worth the effort.
for the main module:
pastebin mxQPcuVA
and my current implementation with two recipes:
pastebin qwTnzYJN
Edit: I missed two debug logs, they're now gone from the pastebin. So no more console spam.